Skip to content
Permalink
Browse files

check if feature has geometry in memory provider iterator, fixes #9309

  • Loading branch information
blazek committed Jan 7, 2014
1 parent 8215183 commit 2daca28939d209b085f5c2ef6fc5f0324eaa371c
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/memory/qgsmemoryfeatureiterator.cpp
@@ -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
@@ -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;
}
}

0 comments on commit 2daca28

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