Don't crash on empty pcad polygons

Fixes sentry KICAD-103
This commit is contained in:
Marek Roszko 2023-04-11 21:38:43 -04:00
parent 01564a254f
commit ed94bc4bf9
1 changed files with 6 additions and 0 deletions

View File

@ -94,6 +94,12 @@ bool PCAD_COPPER_POUR::Parse( XNODE* aNode, const wxString& aDefaultUnits,
// retrieve copper pour outline // retrieve copper pour outline
FormPolygon( lNode, &m_Outline, aDefaultUnits, aActualConversion ); FormPolygon( lNode, &m_Outline, aDefaultUnits, aActualConversion );
if( m_Outline.GetCount() <= 0 )
{
// empty polygon may have been in the file
return false;
}
m_PositionX = m_Outline[0]->x; m_PositionX = m_Outline[0]->x;
m_PositionY = m_Outline[0]->y; m_PositionY = m_Outline[0]->y;
} }