Skip to content

Commit

Permalink
[afs] Correctly return an invalid feature from closed iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent b434ab1 commit 5f12bd5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/providers/arcgisrest/qgsafsfeatureiterator.cpp
Expand Up @@ -62,6 +62,8 @@ QgsAfsFeatureIterator::~QgsAfsFeatureIterator()

bool QgsAfsFeatureIterator::fetchFeature( QgsFeature &f )
{
f.setValid( false );

if ( mClosed )
return false;

Expand All @@ -82,6 +84,7 @@ bool QgsAfsFeatureIterator::fetchFeature( QgsFeature &f )
{
bool result = mSource->sharedData()->getFeature( mRequest.filterFid(), f, fetchGeometries, fetchAttribures );
geometryToDestinationCrs( f, mTransform );
f.setValid( result );
return result;
}
else
Expand All @@ -96,6 +99,7 @@ bool QgsAfsFeatureIterator::fetchFeature( QgsFeature &f )
if ( !success )
continue;
geometryToDestinationCrs( f, mTransform );
f.setValid( true );
return true;
}
}
Expand Down

0 comments on commit 5f12bd5

Please sign in to comment.