Skip to content

Commit 3c5f30b

Browse files
committedApr 29, 2017
Fix Coverity unchecked return value error
1 parent 8633480 commit 3c5f30b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎src/app/nodetool/qgsnodetool.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,12 +1558,14 @@ void QgsNodeTool::deleteVertex()
15581558
for ( int i = 0; i < vertexIds.count(); ++i )
15591559
{
15601560
QgsVertexId vid;
1561-
geom.vertexIdFromVertexNr( vertexIds[i], vid );
1562-
int ringVertexCount = geom.geometry()->vertexCount( vid.part, vid.ring );
1563-
if ( vid.vertex == ringVertexCount - 1 )
1561+
if ( geom.vertexIdFromVertexNr( vertexIds[i], vid ) )
15641562
{
1565-
// this is the last vertex of the ring - remove the first vertex from the list
1566-
duplicateVertexIndices << geom.vertexNrFromVertexId( QgsVertexId( vid.part, vid.ring, 0 ) );
1563+
int ringVertexCount = geom.geometry()->vertexCount( vid.part, vid.ring );
1564+
if ( vid.vertex == ringVertexCount - 1 )
1565+
{
1566+
// this is the last vertex of the ring - remove the first vertex from the list
1567+
duplicateVertexIndices << geom.vertexNrFromVertexId( QgsVertexId( vid.part, vid.ring, 0 ) );
1568+
}
15671569
}
15681570
}
15691571
// now delete the duplicities

0 commit comments

Comments
 (0)
Please sign in to comment.