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() ) {