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