From a855c9a40c7c04e01115c5a5e89d16f8167f358a Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 15 Oct 2022 10:27:00 +0200 Subject: [PATCH] Fix not handled exceptions. --- pcbnew/exporters/export_idf.cpp | 12 ++++++++++-- pcbnew/exporters/exporter_vrml.cpp | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index f560fa0a49..b138fef437 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -281,8 +281,16 @@ static void idf_export_footprint( BOARD* aPcb, FOOTPRINT* aFootprint, IDF3_BOARD if( aPcb->GetProject() ) { - const FP_LIB_TABLE_ROW* fpRow = - aPcb->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false ); + const FP_LIB_TABLE_ROW* fpRow = nullptr; + + try + { + fpRow = aPcb->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false ); + } + catch( ... ) + { + // Not found: do nothing + } if( fpRow ) footprintBasePath = fpRow->GetFullURI( true ); diff --git a/pcbnew/exporters/exporter_vrml.cpp b/pcbnew/exporters/exporter_vrml.cpp index 2f88318366..8f68e4a28f 100644 --- a/pcbnew/exporters/exporter_vrml.cpp +++ b/pcbnew/exporters/exporter_vrml.cpp @@ -999,8 +999,16 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream if( m_board->GetProject() ) { - const FP_LIB_TABLE_ROW* fpRow = - m_board->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false ); + const FP_LIB_TABLE_ROW* fpRow = nullptr; + + try + { + fpRow = m_board->GetProject()->PcbFootprintLibs()->FindRow( libraryName, false ); + } + catch( ... ) + { + // Not found: do nothing + } if( fpRow ) footprintBasePath = fpRow->GetFullURI( true );