Skip to content
Permalink
Browse files

Fix QgsGeometry nearestPoint and minimalEnclosingCircle when the geom…

…etry is empty
  • Loading branch information
github-actions authored and nyalldawson committed May 12, 2020
1 parent e6886a2 commit 448778a4f3d97aea39b4edfc060a726ee05e660f
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();
}
@@ -2166,7 +2166,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 448778a

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