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
  • Loading branch information
wonder-sk committed Feb 21, 2019
1 parent aec87a0 commit 3d99fd5
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 3d99fd5

Please sign in to comment.