Prevent iteration over empty polygon
When utilizing the standard iterator container, we may have polygons with an empty outline (these are generated by gerbview to pcbnew). This should register as the end of the iterator to prevent dereferencing
This commit is contained in:
parent
ead5bfe64b
commit
8cc3c6f159
|
@ -165,7 +165,9 @@ class SHAPE_POLY_SET : public SHAPE
|
|||
|
||||
operator bool() const
|
||||
{
|
||||
return m_currentPolygon <= m_lastPolygon;
|
||||
return ( ( m_currentPolygon < m_lastPolygon ) ||
|
||||
( m_currentPolygon == m_lastPolygon &&
|
||||
m_currentVertex < m_poly->CPolygon( m_currentPolygon )[0].PointCount() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue