Footprint editor: Fix a crash when trying to create a custom pad from selected graphic primitives.

This commit is contained in:
jean-pierre charras 2018-01-12 21:25:45 +01:00
parent 195b85b0c5
commit 52eedc7192
1 changed files with 6 additions and 3 deletions

View File

@ -810,11 +810,14 @@ const std::vector<wxPoint> DRAWSEGMENT::GetPolyPoints() const
{
std::vector<wxPoint> rv;
if( !m_Poly.IsEmpty() )
if( m_Poly.OutlineCount() )
{
for ( auto iter = m_Poly.CIterate(); iter; iter++ )
if( m_Poly.COutline( 0 ).PointCount() )
{
rv.push_back( wxPoint( iter->x, iter->y ) );
for ( auto iter = m_Poly.CIterate(); iter; iter++ )
{
rv.push_back( wxPoint( iter->x, iter->y ) );
}
}
}