Fix not handled exceptions.

This commit is contained in:
jean-pierre charras 2022-10-15 10:27:00 +02:00
parent 8098db2a20
commit a855c9a40c
2 changed files with 20 additions and 4 deletions

View File

@ -281,8 +281,16 @@ static void idf_export_footprint( BOARD* aPcb, FOOTPRINT* aFootprint, IDF3_BOARD
if( aPcb->GetProject() ) if( aPcb->GetProject() )
{ {
const FP_LIB_TABLE_ROW* fpRow = const FP_LIB_TABLE_ROW* fpRow = nullptr;
aPcb->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false );
try
{
fpRow = aPcb->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false );
}
catch( ... )
{
// Not found: do nothing
}
if( fpRow ) if( fpRow )
footprintBasePath = fpRow->GetFullURI( true ); footprintBasePath = fpRow->GetFullURI( true );

View File

@ -999,8 +999,16 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
if( m_board->GetProject() ) if( m_board->GetProject() )
{ {
const FP_LIB_TABLE_ROW* fpRow = const FP_LIB_TABLE_ROW* fpRow = nullptr;
m_board->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false );
try
{
fpRow = m_board->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false );
}
catch( ... )
{
// Not found: do nothing
}
if( fpRow ) if( fpRow )
footprintBasePath = fpRow->GetFullURI( true ); footprintBasePath = fpRow->GetFullURI( true );