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
  • Loading branch information
github-actions[bot] authored and nyalldawson committed May 13, 2020
1 parent e6886a2 commit 448778a
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 @@ -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();
}
Expand Down

0 comments on commit 448778a

Please sign in to comment.