diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index e7943950a9..50147d4e3b 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -212,7 +212,19 @@ void EDA_DRAW_PANEL_GAL::DoRePaint() try { cntUpd.Start(); - m_view->UpdateItems(); + try + { + m_view->UpdateItems(); + } + catch( std::out_of_range& err ) + { + // Don't do anything here but don't fail + // This can happen when we don't catch `at()` calls + wxString msg; + msg.Printf( wxT( "Out of Range error: %s" ), err.what() ); + wxLogDebug( msg ); + } + cntUpd.Stop(); cntCtx.Start();