Skip to content

Commit

Permalink
Add safety check to QgsGeometry::asPolygon. Fixes possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 768f0e8 commit 0add858
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/geometry/qgsgeometry.cpp
Expand Up @@ -1034,6 +1034,9 @@ QgsPolyline QgsGeometry::asPolyline() const

QgsPolygon QgsGeometry::asPolygon() const
{
if ( !d->geometry )
return QgsPolygon();

bool doSegmentation = ( d->geometry->geometryType() == "CurvePolygon" );

QgsPolygonV2* p = nullptr;
Expand Down

0 comments on commit 0add858

Please sign in to comment.