Don't try to update non-existent zone layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6803
This commit is contained in:
Jon Evans 2020-12-24 08:39:38 -05:00
parent 9b43177e74
commit db0df1fdc9
1 changed files with 3 additions and 1 deletions

View File

@ -2390,6 +2390,8 @@ void APPEARANCE_CONTROLS::OnColorSwatchChanged( wxCommandEvent& aEvent )
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView(); KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
view->UpdateLayerColor( layer ); view->UpdateLayerColor( layer );
view->UpdateLayerColor( GetNetnameLayer( layer ) ); view->UpdateLayerColor( GetNetnameLayer( layer ) );
if( layer < PCB_LAYER_ID_COUNT )
view->UpdateLayerColor( ZONE_LAYER_FOR( layer ) ); view->UpdateLayerColor( ZONE_LAYER_FOR( layer ) );
// Update the bitmap of the layer box // Update the bitmap of the layer box