diff --git a/3d-viewer/3d_rendering/opengl/create_scene.cpp b/3d-viewer/3d_rendering/opengl/create_scene.cpp index e3741379c6..04b5cce14d 100644 --- a/3d-viewer/3d_rendering/opengl/create_scene.cpp +++ b/3d-viewer/3d_rendering/opengl/create_scene.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -928,12 +928,20 @@ void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter ) if( m_boardAdapter.GetBoard()->GetProject() ) { - const FP_LIB_TABLE_ROW* fpRow = - m_boardAdapter.GetBoard()->GetProject()->PcbFootprintLibs()->FindRow( - libraryName, false ); + try + { + // FindRow() can throw an exception + const FP_LIB_TABLE_ROW* fpRow = + m_boardAdapter.GetBoard()->GetProject()->PcbFootprintLibs()->FindRow( + libraryName, false ); - if( fpRow ) - footprintBasePath = fpRow->GetFullURI( true ); + if( fpRow ) + footprintBasePath = fpRow->GetFullURI( true ); + } + catch( ... ) + { + // Do nothing if the libraryName is not found in lib table + } } for( const FP_3DMODEL& fp_model : footprint->Models() ) diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index e06b78f0b7..84ab87e48e 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -1258,12 +1258,20 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa wxString footprintBasePath = wxEmptyString; if( m_boardAdapter.GetBoard()->GetProject() ) { - const FP_LIB_TABLE_ROW* fpRow = - m_boardAdapter.GetBoard()->GetProject()->PcbFootprintLibs()->FindRow( - libraryName, false ); + try + { + // FindRow() can throw an exception + const FP_LIB_TABLE_ROW* fpRow = + m_boardAdapter.GetBoard()->GetProject()->PcbFootprintLibs()->FindRow( + libraryName, false ); - if( fpRow ) - footprintBasePath = fpRow->GetFullURI( true ); + if( fpRow ) + footprintBasePath = fpRow->GetFullURI( true ); + } + catch( ... ) + { + // Do nothing if the libraryName is not found in lib table + } } while( sM != eM ) diff --git a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp index 1c8f0ad7eb..febe62539d 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp @@ -219,7 +219,7 @@ TOOL_ACTION EDA_3D_ACTIONS::showSMD( "3DViewer.Control.attributesSMD", TOOL_ACTION EDA_3D_ACTIONS::showVirtual( "3DViewer.Control.attributesOther", AS_ACTIVE, 'V', "", - _( "Toggle Other 3D models" ), _( "Toggle 3D models for 'Other' type components" ), + _( "Toggle unspecified 3D models" ), _( "Toggle 3D models for 'unspecified' type components" ), BITMAPS::show_other, AF_NONE ); TOOL_ACTION EDA_3D_ACTIONS::showNotInPosFile( "3DViewer.Control.attribute_not_in_posfile",