Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash in memory provider (fix #14559)
(cherry-picked from 59d4b85)
  • Loading branch information
nyalldawson committed Apr 4, 2016
1 parent 239a8d6 commit fcbc61a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/memory/qgsmemoryfeatureiterator.cpp
Expand Up @@ -93,15 +93,15 @@ bool QgsMemoryFeatureIterator::nextFeatureUsingList( QgsFeature& feature )
if ( !mRequest.filterRect().isNull() && mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// do exact check in case we're doing intersection
if ( mSource->mFeatures[*mFeatureIdListIterator].geometry() && mSource->mFeatures[*mFeatureIdListIterator].geometry()->intersects( mSelectRectGeom ) )
if ( mSource->mFeatures.value( *mFeatureIdListIterator ).constGeometry() && mSource->mFeatures.value( *mFeatureIdListIterator ).constGeometry()->intersects( mSelectRectGeom ) )
hasFeature = true;
}
else
hasFeature = true;

if ( mSubsetExpression )
{
mSource->mExpressionContext.setFeature( mSource->mFeatures[*mFeatureIdListIterator] );
mSource->mExpressionContext.setFeature( mSource->mFeatures.value( *mFeatureIdListIterator ) );
if ( !mSubsetExpression->evaluate( &mSource->mExpressionContext ).toBool() )
hasFeature = false;
}
Expand All @@ -115,7 +115,7 @@ bool QgsMemoryFeatureIterator::nextFeatureUsingList( QgsFeature& feature )
// copy feature
if ( hasFeature )
{
feature = mSource->mFeatures[*mFeatureIdListIterator];
feature = mSource->mFeatures.value( *mFeatureIdListIterator );
++mFeatureIdListIterator;
}
else
Expand Down

0 comments on commit fcbc61a

Please sign in to comment.