Skip to content

Commit

Permalink
Make sure not to crash if there are no alternatives for right click
Browse files Browse the repository at this point in the history
(cherry picked from commit 3d99fd5)
  • Loading branch information
wonder-sk committed Feb 21, 2019
1 parent bdec90c commit 1991ce6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 1991ce6

Please sign in to comment.