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

This commit is contained in:
Nyall Dawson 2017-09-25 16:46:39 +10:00
parent 6d59d144b5
commit 33ba9a8c48

View File

@ -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;