Skip to content
Permalink
Browse files

fix crash when mPoints.size() == 1

  • Loading branch information
lbartoletti authored and nyalldawson committed Jan 27, 2020
1 parent 78b3da7 commit a9c29c7c2b91c7b758b750b1bc96504051def7ff
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/app/qgsmaptooladdcircularstring.cpp
@@ -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;
@@ -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() );

0 comments on commit a9c29c7

Please sign in to comment.
You can’t perform that action at this time.