Ensure a layer exists before using it.
Fixes #15170 https://gitlab.com/kicad/code/kicad/-/issues/15170
This commit is contained in:
parent
f8f29b55cb
commit
74c5f5a054
|
@ -248,9 +248,12 @@ 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() )
|
||||
{
|
||||
if( visibleLayers.any() )
|
||||
aLayer = visibleLayers.Seq().back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normal path: get the layer base color
|
||||
COLOR4D color = m_layerColors[aLayer];
|
||||
|
|
Loading…
Reference in New Issue