Skip to content

Commit

Permalink
nodetool: fix crash when deleting last vertex (fixes #10367)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 1, 2014
1 parent 701c227 commit a516c36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/nodetool/qgsselectedfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ void QgsSelectedFeature::createVertexMap()

void QgsSelectedFeature::selectVertex( int vertexNr )
{
if ( vertexNr < 0 || vertexNr >= mVertexMap.size() )
return;

QgsVertexEntry *entry = mVertexMap[vertexNr];
entry->setSelected();
entry->update();
Expand All @@ -550,6 +553,9 @@ void QgsSelectedFeature::selectVertex( int vertexNr )

void QgsSelectedFeature::deselectVertex( int vertexNr )
{
if ( vertexNr < 0 || vertexNr >= mVertexMap.size() )
return;

QgsVertexEntry *entry = mVertexMap[vertexNr];
entry->setSelected( false );
entry->update();
Expand All @@ -574,6 +580,9 @@ void QgsSelectedFeature::deselectAllVertexes()

void QgsSelectedFeature::invertVertexSelection( int vertexNr, bool invert )
{
if ( vertexNr < 0 || vertexNr >= mVertexMap.size() )
return;

QgsVertexEntry *entry = mVertexMap[vertexNr];

bool selected = !entry->isSelected();
Expand Down

0 comments on commit a516c36

Please sign in to comment.