Skip to content

Commit

Permalink
Consistently return null geometry instead of empty point
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 12, 2022
1 parent 5a6b76a commit 36f9698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeos.cpp
Expand Up @@ -1368,7 +1368,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq_r( geosinit()->ctxt, geos );
unsigned int nPoints = 0;
GEOSCoordSeq_getSize_r( geosinit()->ctxt, cs, &nPoints );
return nPoints > 0 ? std::unique_ptr<QgsAbstractGeometry>( coordSeqPoint( cs, 0, hasZ, hasM ).clone() ) : std::make_unique< QgsPoint >();
return nPoints > 0 ? std::unique_ptr<QgsAbstractGeometry>( coordSeqPoint( cs, 0, hasZ, hasM ).clone() ) : nullptr;
}
case GEOS_LINESTRING:
{
Expand Down

0 comments on commit 36f9698

Please sign in to comment.