Skip to content

Commit 3d99fd5

Browse files
committedFeb 21, 2019
Make sure not to crash if there are no alternatives for right click
1 parent aec87a0 commit 3d99fd5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
 

‎src/app/vertextool/qgsvertextool.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,14 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
968968
}
969969
}
970970

971-
// move to the next alternative
972-
if ( mSelectedFeatureAlternatives->index < mSelectedFeatureAlternatives->alternatives.count() - 1 )
973-
++mSelectedFeatureAlternatives->index;
974-
else
975-
mSelectedFeatureAlternatives->index = -1;
971+
if ( mSelectedFeatureAlternatives )
972+
{
973+
// move to the next alternative
974+
if ( mSelectedFeatureAlternatives->index < mSelectedFeatureAlternatives->alternatives.count() - 1 )
975+
++mSelectedFeatureAlternatives->index;
976+
else
977+
mSelectedFeatureAlternatives->index = -1;
978+
}
976979

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

0 commit comments

Comments
 (0)