Don't crash on empty pcad polygons

Fixes sentry KICAD-103
This commit is contained in:
Mark Roszko 2023-04-12 01:41:06 +00:00
parent 1f34883a27
commit fb1cc72013
1 changed files with 6 additions and 0 deletions

View File

@ -94,6 +94,12 @@ bool PCB_COPPER_POUR::Parse( XNODE* aNode, const wxString& aDefaultUnits,
// retrieve copper pour outline
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_positionY = m_outline[0]->y;
}