Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix QgsGeometry nearestPoint and minimalEnclosingCircle when the geom…
…etry is empty

fix #36142
  • Loading branch information
Bertrand Rix committed May 12, 2020
1 parent a11a121 commit 843860e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometry.cpp
Expand Up @@ -1072,7 +1072,7 @@ QgsGeometry QgsGeometry::minimalEnclosingCircle( QgsPointXY &center, double &rad
center = QgsPointXY();
radius = 0;

if ( !d->geometry )
if ( isEmpty() )
{
return QgsGeometry();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeos.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit 843860e

Please sign in to comment.