Skip to content
Permalink
Browse files

Merge pull request #39348 from m-kuhn/fix_33234

Fix crash when snapping to curved geometry without curved segments
  • Loading branch information
m-kuhn committed Oct 14, 2020
2 parents 1e80643 + a72d84a commit 00b53831d16e5fff466283644380a2f639a6abc4
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/qgspointlocator.cpp
@@ -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();

0 comments on commit 00b5383

Please sign in to comment.
You can’t perform that action at this time.