Skip to content

Commit

Permalink
Merge pull request #39348 from m-kuhn/fix_33234
Browse files Browse the repository at this point in the history
Fix crash when snapping to curved geometry without curved segments
  • Loading branch information
m-kuhn committed Oct 14, 2020
2 parents 1e80643 + a72d84a commit 00b5383
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/qgspointlocator.cpp
Expand Up @@ -466,8 +466,10 @@ static QgsPointLocator::MatchList _geometrySegmentsInRect( QgsGeometry *geom, co
for ( auto part = straightGeom.const_parts_begin(); part != straightGeom.const_parts_end(); ++part )
{
// Checking for invalid linestrings
// A linestring should/(must?) have at least two points
if ( qgsgeometry_cast<QgsLineString *>( *part )->numPoints() < 2 )
// A linestring should/(must?) have at least two points.
QgsCurve *curve = qgsgeometry_cast<QgsCurve *>( *part );
Q_ASSERT( !curve->hasCurvedSegments() );
if ( curve->numPoints() < 2 )
continue;

QgsAbstractGeometry::vertex_iterator it = ( *part )->vertices_begin();
Expand Down

0 comments on commit 00b5383

Please sign in to comment.