Make sure that we have a visible layer
Before setting the active layer to our visible sequence, make sure that the sequence is not empty (leads to invalid layer id->crash) Fixes https://gitlab.com/kicad/code/kicad/issues/11629
This commit is contained in:
parent
bda1f684fc
commit
0d93be0af2
|
@ -1784,7 +1784,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
visible &= ~presetAllCopper.layers;
|
visible &= ~presetAllCopper.layers;
|
||||||
|
|
||||||
if( !visible.test( current ) )
|
if( !visible.test( current ) && visible.count() > 0 )
|
||||||
m_frame->SetActiveLayer( *visible.Seq().begin() );
|
m_frame->SetActiveLayer( *visible.Seq().begin() );
|
||||||
|
|
||||||
setVisibleLayers( visible );
|
setVisibleLayers( visible );
|
||||||
|
@ -1795,7 +1795,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
visible &= presetAllCopper.layers;
|
visible &= presetAllCopper.layers;
|
||||||
|
|
||||||
if( !visible.test( current ) )
|
if( !visible.test( current ) && visible.count() > 0 )
|
||||||
m_frame->SetActiveLayer( *visible.Seq().begin() );
|
m_frame->SetActiveLayer( *visible.Seq().begin() );
|
||||||
|
|
||||||
setVisibleLayers( visible );
|
setVisibleLayers( visible );
|
||||||
|
|
Loading…
Reference in New Issue