Skip to content

Commit 448778a

Browse files
github-actions[bot]nyalldawson
authored andcommittedMay 13, 2020
Fix QgsGeometry nearestPoint and minimalEnclosingCircle when the geometry is empty
1 parent e6886a2 commit 448778a

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
@@ -2166,7 +2166,7 @@ QgsGeometry QgsGeos::mergeLines( QString *errorMsg ) const
21662166

21672167
QgsGeometry QgsGeos::closestPoint( const QgsGeometry &other, QString *errorMsg ) const
21682168
{
2169-
if ( !mGeos || other.isNull() )
2169+
if ( !mGeos || isEmpty() || other.isNull() )
21702170
{
21712171
return QgsGeometry();
21722172
}

0 commit comments

Comments
 (0)
Please sign in to comment.