From a4e9beeeac2aab8f9fae54043eafaba6380cb85a Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 15 Nov 2021 14:02:28 -0500 Subject: [PATCH] Coverity issue fix. --- pcbnew/pcb_base_frame.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index bf81b44180..92eb9ece79 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -304,7 +304,17 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer ) switch( aItem->Type() ) { case PCB_FOOTPRINT_T: - itemPoly = static_cast( aItem )->GetBoundingHull(); + try + { + itemPoly = static_cast( aItem )->GetBoundingHull(); + } + catch( const ClipperLib::clipperException& exc ) + { + // This may be overkill and could be an assertion but we are more likely to find + // any clipper errors this way. + wxLogError( wxT( "Clipper library exception '%s' occurred." ), exc.what() ); + } + break; case PCB_PAD_T: