Skip to content

Commit

Permalink
Fix Coverity unchecked return value error
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 29, 2017
1 parent 8633480 commit 3c5f30b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/nodetool/qgsnodetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1558,12 +1558,14 @@ void QgsNodeTool::deleteVertex()
for ( int i = 0; i < vertexIds.count(); ++i )
{
QgsVertexId vid;
geom.vertexIdFromVertexNr( vertexIds[i], vid );
int ringVertexCount = geom.geometry()->vertexCount( vid.part, vid.ring );
if ( vid.vertex == ringVertexCount - 1 )
if ( geom.vertexIdFromVertexNr( vertexIds[i], vid ) )
{
// this is the last vertex of the ring - remove the first vertex from the list
duplicateVertexIndices << geom.vertexNrFromVertexId( QgsVertexId( vid.part, vid.ring, 0 ) );
int ringVertexCount = geom.geometry()->vertexCount( vid.part, vid.ring );
if ( vid.vertex == ringVertexCount - 1 )
{
// this is the last vertex of the ring - remove the first vertex from the list
duplicateVertexIndices << geom.vertexNrFromVertexId( QgsVertexId( vid.part, vid.ring, 0 ) );
}
}
}
// now delete the duplicities
Expand Down

0 comments on commit 3c5f30b

Please sign in to comment.