diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index f755c280a1..338baff1b1 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -470,7 +470,7 @@ void EDA_3D_VIEWER_FRAME::applyViewport( const wxString& aViewportName ) { int idx = m_cbViewports->FindString( aViewportName ); - if( idx >= 0 ) + if( idx >= 0 && idx < m_cbViewports->GetCount() - 3 /* separator */ ) { m_cbViewports->SetSelection( idx ); m_lastSelectedViewport = static_cast( m_cbViewports->GetClientData( idx ) );