Ensure a layer exists before using it.

Fixes #15170
https://gitlab.com/kicad/code/kicad/-/issues/15170
This commit is contained in:
jean-pierre charras 2023-07-11 16:19:19 +02:00
parent f8f29b55cb
commit 74c5f5a054
1 changed files with 4 additions and 1 deletions

View File

@ -248,7 +248,10 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
else if( GetActiveLayer() == B_Mask && visibleLayers.test( B_Mask ) )
aLayer = B_Mask;
else if( ( visibleLayers & LSET::AllCuMask() ).none() )
aLayer = visibleLayers.Seq().back();
{
if( visibleLayers.any() )
aLayer = visibleLayers.Seq().back();
}
}
}