Fix not handled exception, creating a crash.

Fixes #12536
https://gitlab.com/kicad/code/kicad/issues/12536
This commit is contained in:
jean-pierre charras 2022-09-29 13:08:23 +02:00
parent 46b0c116cd
commit b5dfa4e2fb
1 changed files with 10 additions and 2 deletions

View File

@ -429,10 +429,18 @@ MODEL_VALIDATE_ERRORS PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists( const w
return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME; return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME;
wxString libraryName = m_footprint->GetFPID().GetLibNickname(); wxString libraryName = m_footprint->GetFPID().GetLibNickname();
const FP_LIB_TABLE_ROW* fpRow = const FP_LIB_TABLE_ROW* fpRow = nullptr;
m_frame->Prj().PcbFootprintLibs()->FindRow( libraryName, false ); try
{
fpRow = m_frame->Prj().PcbFootprintLibs()->FindRow( libraryName, false );
}
catch( ... )
{
// if libraryName is not found in table, do nothing
}
wxString footprintBasePath = wxEmptyString; wxString footprintBasePath = wxEmptyString;
if( fpRow ) if( fpRow )
footprintBasePath = fpRow->GetFullURI( true ); footprintBasePath = fpRow->GetFullURI( true );