Skip to content

Instantly share code, notes, and snippets.

@jef-n
Created March 30, 2013 18:08
Show Gist options
  • Save jef-n/5277716 to your computer and use it in GitHub Desktop.
Save jef-n/5277716 to your computer and use it in GitHub Desktop.
diff --git a/src/providers/memory/qgsmemoryfeatureiterator.cpp b/src/providers/memory/qgsmemoryfeatureiterator.cpp
index 0e23f97..24fba43 100644
--- a/src/providers/memory/qgsmemoryfeatureiterator.cpp
+++ b/src/providers/memory/qgsmemoryfeatureiterator.cpp
@@ -106,6 +106,8 @@ bool QgsMemoryFeatureIterator::nextFeatureUsingList( QgsFeature& feature )
if ( hasFeature )
{
feature = P->mFeatures[*mFeatureIdListIterator];
+ if( !feature.fields() )
+ feature.setFields( &P->mFields ); // allow name-based attribute lookups
mFeatureIdListIterator++;
}
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment