Skip to content
Permalink
Browse files

Fix crash in memory provider (fix #14559)

(cherry-picked from 59d4b85)
  • Loading branch information
nyalldawson committed Apr 4, 2016
1 parent 239a8d6 commit fcbc61af0d13bcf02df80e94d73928cfe5fae889
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/memory/qgsmemoryfeatureiterator.cpp
@@ -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;
}
@@ -115,7 +115,7 @@ bool QgsMemoryFeatureIterator::nextFeatureUsingList( QgsFeature& feature )
// copy feature
if ( hasFeature )
{
feature = mSource->mFeatures[*mFeatureIdListIterator];
feature = mSource->mFeatures.value( *mFeatureIdListIterator );
++mFeatureIdListIterator;
}
else

0 comments on commit fcbc61a

Please sign in to comment.
You can’t perform that action at this time.