Skip to content
Permalink
Browse files

Fix crash in geometry collection when working with empty collections

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent 623a57a commit 6d59d144b588dc66ae7d70bcfbfaad86bbd3b363
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/core/geometry/qgsgeometrycollection.cpp
@@ -624,11 +624,21 @@ double QgsGeometryCollection::vertexAngle( QgsVertexId vertex ) const

int QgsGeometryCollection::vertexCount( int part, int ring ) const
{
if ( part < 0 || part >= mGeometries.size() )
{
return 0;
}

return mGeometries[part]->vertexCount( 0, ring );
}

int QgsGeometryCollection::ringCount( int part ) const
{
if ( part < 0 || part >= mGeometries.size() )
{
return 0;
}

return mGeometries[part]->ringCount();
}

0 comments on commit 6d59d14

Please sign in to comment.
You can’t perform that action at this time.