Don't query first item of empty vector.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16687
This commit is contained in:
Jeff Young 2024-01-21 22:33:04 +00:00
parent 2627c99654
commit 6fca467e2a
1 changed files with 1 additions and 1 deletions

View File

@ -350,7 +350,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector<BOARD_ITEM*> aItems, PCB_LAYER_ID
focusPt = item->GetPosition();
if( aLayer == UNDEFINED_LAYER )
if( aLayer == UNDEFINED_LAYER && item->GetLayerSet().any() )
aLayer = item->GetLayerSet().Seq()[0];
switch( item->Type() )