FP editor: fix crash when trying to save a footprint after removing its library

Fixes #13619
https://gitlab.com/kicad/code/kicad/issues/13619
This commit is contained in:
jean-pierre charras 2023-01-21 18:18:38 +01:00
parent 0a7bd85cd6
commit df4f9d4c94
1 changed files with 11 additions and 1 deletions

View File

@ -831,7 +831,17 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprint( FOOTPRINT* aFootprint )
// Legacy libraries are readable, but modifying legacy format is not allowed // Legacy libraries are readable, but modifying legacy format is not allowed
// So prompt the user if he try to add/replace a footprint in a legacy lib // So prompt the user if he try to add/replace a footprint in a legacy lib
wxString libfullname = tbl->FindRow( libraryName )->GetFullURI(); wxString libfullname;
try
{
libfullname = tbl->FindRow( libraryName )->GetFullURI();
}
catch( IO_ERROR& error )
{
DisplayInfoMessage( this, error.What() );
return false;
}
if( IO_MGR::GuessPluginTypeFromLibPath( libfullname ) == IO_MGR::LEGACY ) if( IO_MGR::GuessPluginTypeFromLibPath( libfullname ) == IO_MGR::LEGACY )
{ {