Skip to content
Permalink
Browse files

Fix QgsGeometry nearestPoint and minimalEnclosingCircle when the geom…

…etry is empty

fix #36142
  • Loading branch information
obrix committed May 12, 2020
1 parent a11a121 commit 843860e2c0fab1ca9c2a4086ccc8228acbf3572b
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/geometry/qgsgeometry.cpp
  2. +1 −1 src/core/geometry/qgsgeos.cpp
@@ -1072,7 +1072,7 @@ QgsGeometry QgsGeometry::minimalEnclosingCircle( QgsPointXY &center, double &rad
center = QgsPointXY();
radius = 0;

if ( !d->geometry )
if ( isEmpty() )
{
return QgsGeometry();
}
@@ -2213,7 +2213,7 @@ QgsGeometry QgsGeos::mergeLines( QString *errorMsg ) const

QgsGeometry QgsGeos::closestPoint( const QgsGeometry &other, QString *errorMsg ) const
{
if ( !mGeos || other.isNull() )
if ( !mGeos || isEmpty() || other.isNull() )
{
return QgsGeometry();
}

0 comments on commit 843860e

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