Move up a layer validity check to prevent crash

Fixes sentry crash KICAD-RF
This commit is contained in:
Marek Roszko 2023-03-25 17:12:13 -04:00
parent 1788db53e5
commit 604a7d69db
1 changed files with 3 additions and 3 deletions

View File

@ -2202,7 +2202,9 @@ void EAGLE_PLUGIN::packagePolygon( FOOTPRINT* aFootprint, wxXmlNode* aTree ) con
}
}
if( p.pour == EPOLYGON::CUTOUT
PCB_LAYER_ID layer = kicad_layer( p.layer );
if( ( p.pour == EPOLYGON::CUTOUT && layer != UNDEFINED_LAYER )
|| p.layer == EAGLE_LAYER::TRESTRICT
|| p.layer == EAGLE_LAYER::BRESTRICT
|| p.layer == EAGLE_LAYER::VRESTRICT )
@ -2221,8 +2223,6 @@ void EAGLE_PLUGIN::packagePolygon( FOOTPRINT* aFootprint, wxXmlNode* aTree ) con
}
else
{
PCB_LAYER_ID layer = kicad_layer( p.layer );
if( layer == UNDEFINED_LAYER )
{
wxLogMessage( wxString::Format( _( "Ignoring a polygon since Eagle layer '%s' (%d) "