diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 99d51325b5..0be79b495e 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -565,7 +565,7 @@ void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ) for( auto ii: menuList ) { wxMenuItem* item = menuBar->FindItem( ii.menuId ); - if( ii.galType == canvasType ) + if( item && ii.galType == canvasType ) { item->Check( true ); }