Skip to content

Commit 8b10b33

Browse files
github-actions[bot]nyalldawson
authored andcommittedMay 12, 2020
Fix QgsGeometry nearestPoint and minimalEnclosingCircle when the geometry is empty
1 parent b3d168f commit 8b10b33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/core/geometry/qgsgeometry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ QgsGeometry QgsGeometry::minimalEnclosingCircle( QgsPointXY &center, double &rad
10721072
center = QgsPointXY();
10731073
radius = 0;
10741074

1075-
if ( !d->geometry )
1075+
if ( isEmpty() )
10761076
{
10771077
return QgsGeometry();
10781078
}

‎src/core/geometry/qgsgeos.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ QgsGeometry QgsGeos::mergeLines( QString *errorMsg ) const
22132213

22142214
QgsGeometry QgsGeos::closestPoint( const QgsGeometry &other, QString *errorMsg ) const
22152215
{
2216-
if ( !mGeos || other.isNull() )
2216+
if ( !mGeos || isEmpty() || other.isNull() )
22172217
{
22182218
return QgsGeometry();
22192219
}

0 commit comments

Comments
 (0)