Skip to content
Permalink
Browse files

Fix crash when trying to insert geometry into collection with bad index

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent 6d59d14 commit 33ba9a8c48a170cf93f780bf72798a40a8e3dc68
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/geometry/qgsgeometrycollection.cpp
@@ -128,6 +128,8 @@ bool QgsGeometryCollection::insertGeometry( QgsAbstractGeometry *g, int index )
return false;
}

index = std::min( mGeometries.count(), index );

mGeometries.insert( index, g );
clearCache(); //set bounding box invalid
return true;

0 comments on commit 33ba9a8

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