Handle empty shape in removeCornerCondition

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9495
This commit is contained in:
Jon Evans 2021-10-30 13:09:59 -04:00
parent d4537b6f53
commit d426abafd7
1 changed files with 5 additions and 1 deletions

View File

@ -814,7 +814,11 @@ bool EE_POINT_EDITOR::removeCornerCondition( const SELECTION& )
if( !m_editPoints || !m_editedPoint || m_editPoints->GetParent()->Type() != LIB_SHAPE_T )
return false;
LIB_SHAPE* shape = static_cast<LIB_SHAPE*>( m_editPoints->GetParent() );
LIB_SHAPE* shape = static_cast<LIB_SHAPE*>( m_editPoints->GetParent() );
if( shape->GetPolyShape().IsEmpty() )
return false;
SHAPE_LINE_CHAIN& poly = shape->GetPolyShape().Outline( 0 );
if( poly.GetPointCount() < 3 )