ConvertOutlineToPolygon: Don't crash if we didn't find a segment owner

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8184
This commit is contained in:
Jon Evans 2021-04-12 19:59:51 -04:00
parent 715c61ac9f
commit 94fad2944d
1 changed files with 6 additions and 2 deletions

View File

@ -844,7 +844,9 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET&
{
BOARD_ITEM* a = fetchOwner( *seg1 );
BOARD_ITEM* b = fetchOwner( *seg2 );
(*aErrorHandler)( _( "(self-intersecting)" ), a, b, (wxPoint) ( *seg1 ).A );
if( a && b )
(*aErrorHandler)( _( "(self-intersecting)" ), a, b, (wxPoint) ( *seg1 ).A );
}
selfIntersecting = true;
@ -856,7 +858,9 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET&
{
BOARD_ITEM* a = fetchOwner( *seg1 );
BOARD_ITEM* b = fetchOwner( *seg2 );
(*aErrorHandler)( _( "(self-intersecting)" ), a, b, (wxPoint) pt.get() );
if( a && b )
(*aErrorHandler)( _( "(self-intersecting)" ), a, b, (wxPoint) pt.get() );
}
selfIntersecting = true;