Skip to content

Commit 0add858

Browse files
committed
Add safety check to QgsGeometry::asPolygon. Fixes possible crash
1 parent 768f0e8 commit 0add858

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/geometry/qgsgeometry.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,9 @@ QgsPolyline QgsGeometry::asPolyline() const
10341034

10351035
QgsPolygon QgsGeometry::asPolygon() const
10361036
{
1037+
if ( !d->geometry )
1038+
return QgsPolygon();
1039+
10371040
bool doSegmentation = ( d->geometry->geometryType() == "CurvePolygon" );
10381041

10391042
QgsPolygonV2* p = nullptr;

0 commit comments

Comments
 (0)