Browse Source

FP editor: fix crash when trying to save a footprint (Ctrl+S) when no footprint loaded.

pull/15/head
jean-pierre charras 6 years ago
parent
commit
176b1a0fd5
  1. 3
      pcbnew/footprint_editor_utils.cpp
  2. 3
      pcbnew/footprint_libraries_utils.cpp

3
pcbnew/footprint_editor_utils.cpp

@ -255,6 +255,9 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_MODEDIT_SAVE:
if( !GetBoard()->GetFirstModule() ) // no loaded footprint
break;
if( GetTargetFPID() == GetLoadedFPID() )
{
if( SaveFootprint( GetBoard()->GetFirstModule() ) )

3
pcbnew/footprint_libraries_utils.cpp

@ -706,6 +706,9 @@ void PCB_EDIT_FRAME::ArchiveModulesOnBoard( bool aStoreInNewLib, const wxString&
bool FOOTPRINT_EDIT_FRAME::SaveFootprint( MODULE* aModule )
{
if( !aModule ) // Happen if no footprint loaded
return false;
wxString libraryName = aModule->GetFPID().GetLibNickname();
wxString footprintName = aModule->GetFPID().GetLibItemName();
bool nameChanged = m_footprintNameWhenLoaded != footprintName;

Loading…
Cancel
Save