Skip to content

Commit cbd88ee

Browse files
committed
fix #5487
1 parent a1bf57a commit cbd88ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/qgsgeometry.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -5572,8 +5572,11 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
55725572
{
55735573
//make sure there are at least two intersection between line and reshape geometry
55745574
GEOSGeometry* intersectGeom = GEOSIntersection( line, reshapeLineGeos );
5575-
atLeastTwoIntersections = ( GEOSGeomTypeId( intersectGeom ) == GEOS_MULTIPOINT && GEOSGetNumGeometries( intersectGeom ) > 1 );
5576-
GEOSGeom_destroy( intersectGeom );
5575+
if ( intersectGeom )
5576+
{
5577+
atLeastTwoIntersections = ( GEOSGeomTypeId( intersectGeom ) == GEOS_MULTIPOINT && GEOSGetNumGeometries( intersectGeom ) > 1 );
5578+
GEOSGeom_destroy( intersectGeom );
5579+
}
55775580
}
55785581
catch ( GEOSException &e )
55795582
{

0 commit comments

Comments
 (0)