Skip to content

Commit

Permalink
fix crash when mPoints.size() == 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 5, 2020
1 parent fd493ff commit fa15379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsmaptooladdcircularstring.cpp
Expand Up @@ -55,7 +55,7 @@ void QgsMapToolAddCircularString::keyPressEvent( QKeyEvent *e )
createCenterPointRubberBand();
}

if ( e && e->key() == Qt::Key_Escape )
if ( ( e && e->key() == Qt::Key_Escape ) || ( ( e && e->key() == Qt::Key_Backspace ) && ( mPoints.size() == 1 ) ) )
{
mPoints.clear();
delete mRubberBand;
Expand All @@ -66,7 +66,7 @@ void QgsMapToolAddCircularString::keyPressEvent( QKeyEvent *e )
if ( mParentTool )
mParentTool->keyPressEvent( e );
}
if ( ( e && e->key() == Qt::Key_Backspace ) && ( ! mPoints.isEmpty() ) )
if ( ( e && e->key() == Qt::Key_Backspace ) && ( mPoints.size() > 1 ) )
{
mPoints.removeLast();
std::unique_ptr<QgsCircularString> geomRubberBand( new QgsCircularString() );
Expand Down

0 comments on commit fa15379

Please sign in to comment.