Skip to content

Commit

Permalink
check if feature has geometry in memory provider iterator, fixes #9309
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jan 7, 2014
1 parent 8215183 commit 2daca28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/memory/qgsmemoryfeatureiterator.cpp
Expand Up @@ -86,7 +86,7 @@ bool QgsMemoryFeatureIterator::nextFeatureUsingList( QgsFeature& feature )
if ( mRequest.filterType() == QgsFeatureRequest::FilterRect && mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// do exact check in case we're doing intersection
if ( P->mFeatures[*mFeatureIdListIterator].geometry()->intersects( mSelectRectGeom ) )
if ( P->mFeatures[*mFeatureIdListIterator].geometry() && P->mFeatures[*mFeatureIdListIterator].geometry()->intersects( mSelectRectGeom ) )
hasFeature = true;
}
else
Expand Down Expand Up @@ -131,13 +131,13 @@ bool QgsMemoryFeatureIterator::nextFeatureTraverseAll( QgsFeature& feature )
if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// using exact test when checking for intersection
if ( mSelectIterator->geometry()->intersects( mSelectRectGeom ) )
if ( mSelectIterator->geometry() && mSelectIterator->geometry()->intersects( mSelectRectGeom ) )
hasFeature = true;
}
else
{
// check just bounding box against rect when not using intersection
if ( mSelectIterator->geometry()->boundingBox().intersects( mRequest.filterRect() ) )
if ( mSelectIterator->geometry() && mSelectIterator->geometry()->boundingBox().intersects( mRequest.filterRect() ) )
hasFeature = true;
}
}
Expand Down

0 comments on commit 2daca28

Please sign in to comment.