Skip to content
Permalink
Browse files
Fix crash in vector layer iteration on Qt6 builds
Decrementing an iterator which is already at the beginning results
in a crash

(cherry picked from commit 6776b1b)
  • Loading branch information
nyalldawson committed Aug 17, 2021
1 parent b6d3038 commit 79e247b11ce49a188af6707570efeccf76c78f2a
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/qgsvectorlayerfeatureiterator.cpp
@@ -530,7 +530,8 @@ bool QgsVectorLayerFeatureIterator::isValid() const

bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature &f )
{
while ( mFetchAddedFeaturesIt-- != mSource->mAddedFeatures.constBegin() )
while ( mFetchAddedFeaturesIt != mSource->mAddedFeatures.constBegin() &&
mFetchAddedFeaturesIt-- != mSource->mAddedFeatures.constBegin() )
{
QgsFeatureId fid = mFetchAddedFeaturesIt->id();

0 comments on commit 79e247b

Please sign in to comment.