diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index b654328eba..c2e7272539 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -401,7 +401,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) LSET layersList = getActiveLayers( it ); violationLayers &= layersList; - if( principalLayer <= UNDEFINED_LAYER ) + if( principalLayer <= UNDEFINED_LAYER && layersList.count() ) principalLayer = layersList.Seq().front(); } }