Skip to content

Commit

Permalink
qgscurvepolygon.cpp: avoid cppcheck warning about potential nullptr d…
Browse files Browse the repository at this point in the history
…ereference
  • Loading branch information
rouault authored and nyalldawson committed Aug 15, 2021
1 parent e205c0d commit 70c73b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/geometry/qgscurvepolygon.cpp
Expand Up @@ -940,11 +940,11 @@ int QgsCurvePolygon::vertexNumberFromVertexId( QgsVertexId id ) const
if ( id.part != 0 )
return -1;

if ( id.ring < 0 || id.ring >= ringCount() )
if ( id.ring < 0 || id.ring >= ringCount() || !mExteriorRing )
return -1;

int number = 0;
if ( id.ring == 0 && mExteriorRing )
if ( id.ring == 0 )
{
return mExteriorRing->vertexNumberFromVertexId( QgsVertexId( 0, 0, id.vertex ) );
}
Expand Down

0 comments on commit 70c73b1

Please sign in to comment.