Skip to content
Permalink
Browse files

Make sure not to crash if there are no alternatives for right click

(cherry picked from commit 3d99fd5)
  • Loading branch information
wonder-sk committed Feb 21, 2019
1 parent bdec90c commit 1991ce6188cfa3afbdbbc70a327dbd29cb892d41
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/app/vertextool/qgsvertextool.cpp
@@ -968,11 +968,14 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
}
}

// move to the next alternative
if ( mSelectedFeatureAlternatives->index < mSelectedFeatureAlternatives->alternatives.count() - 1 )
++mSelectedFeatureAlternatives->index;
else
mSelectedFeatureAlternatives->index = -1;
if ( mSelectedFeatureAlternatives )
{
// move to the next alternative
if ( mSelectedFeatureAlternatives->index < mSelectedFeatureAlternatives->alternatives.count() - 1 )
++mSelectedFeatureAlternatives->index;
else
mSelectedFeatureAlternatives->index = -1;
}

if ( mSelectedFeatureAlternatives && mSelectedFeatureAlternatives->index != -1 )
{

0 comments on commit 1991ce6

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