Skip to content

Commit b53e80b

Browse files
committed
[memory provider] Don't crash on updateExtent and feature without geometry
1 parent ab54176 commit b53e80b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/providers/memory/qgsmemoryprovider.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,11 @@ void QgsMemoryProvider::updateExtent()
422422
}
423423
else
424424
{
425-
mExtent = mFeatures.begin().value().geometry()->boundingBox();
426-
for ( QgsFeatureMap::iterator it = mFeatures.begin(); it != mFeatures.end(); ++it )
427-
mExtent.unionRect( it.value().geometry()->boundingBox() );
425+
Q_FOREACH( const QgsFeature& feat, mFeatures )
426+
{
427+
if ( feat.geometry() )
428+
mExtent.unionRect( feat.geometry()->boundingBox() );
429+
}
428430
}
429431
}
430432

0 commit comments

Comments
 (0)