diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 00854f133f..b6299e8208 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -350,7 +350,7 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) int id = *evt->GetCommandId(); // User has pointed an item, so show it in a different way - if( id >= 0 ) + if( id >= 0 && id < limit ) { current = ( *aCollector )[id]; current->SetBrightened();