From 34527630d0d5f177696660857fdd62fe4e4d2630 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 16 Sep 2020 12:06:41 +0100 Subject: [PATCH] Small cleanup --- pcbnew/netlist_reader/netlist.cpp | 4 ++-- pcbnew/widgets/appearance_controls.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 569ce11946..02ad84dd22 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -185,7 +185,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter ) if( component->GetFPID() != lastFPID ) { - module = NULL; + module = nullptr; // The LIB_ID is ok as long as there is a footprint portion coming the library if // it's needed. Nickname can be blank. @@ -219,7 +219,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter ) else { // Footprint already loaded from a library, duplicate it (faster) - if( module == NULL ) + if( !module ) continue; // Module does not exist in any library. module = new MODULE( *module ); diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index b6c7d2db4e..504ce1bbcf 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -2169,7 +2169,8 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent ) m_lastSelectedUserPreset = ( !preset || preset->readOnly ) ? nullptr : preset; - doApplyLayerPreset( *preset ); + if( !preset ) + doApplyLayerPreset( *preset ); if( !m_currentPreset->name.IsEmpty() ) {