Skip to content

Commit

Permalink
Fix crash in vector layer iteration on Qt6 builds
Browse files Browse the repository at this point in the history
Decrementing an iterator which is already at the beginning results
in a crash

(cherry picked from commit 6776b1b)
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Jul 23, 2021
1 parent cd6c395 commit c9715e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit c9715e5

Please sign in to comment.