diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index d7268cc96d..c6b2c73b78 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -3015,8 +3015,13 @@ bool FOOTPRINT::cmp_drawings::operator()( const BOARD_ITEM* itemA, const BOARD_I TEST( dwgA->GetShape(), dwgB->GetShape() ); - TEST_PT( dwgA->GetStart(), dwgB->GetStart() ); - TEST_PT( dwgA->GetEnd(), dwgB->GetEnd() ); + // GetStart() and GetEnd() have no meaning with polygons. + // We cannot use them for sorting polygons + if( dwgA->GetShape() != SHAPE_T::POLY ) + { + TEST_PT( dwgA->GetStart(), dwgB->GetStart() ); + TEST_PT( dwgA->GetEnd(), dwgB->GetEnd() ); + } if( dwgA->GetShape() == SHAPE_T::ARC ) {