Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qgis/Quantum-GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 5, 2013
2 parents 813459d + f428c86 commit 4df00a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsfield.h
Expand Up @@ -196,6 +196,10 @@ class CORE_EXPORT QgsFields
inline int count() const { return mFields.count(); }
//! Return number of items
inline int size() const { return mFields.count(); }
//! Return if a field index is valid
//! @param i Index of the field which needs to be checked
//! @return True if the field exists
inline bool exists( int i ) const { return i >= 0 && i < mFields.count(); }

//! Get field at particular index (must be in range 0..N-1)
inline const QgsField& operator[]( int i ) const { return mFields[i].field; }
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -351,6 +351,9 @@ void QgsVectorLayerFeatureIterator::prepareJoins()

for ( QgsAttributeList::const_iterator attIt = fetchAttributes.constBegin(); attIt != fetchAttributes.constEnd(); ++attIt )
{
if ( !fields.exists( *attIt ) )
continue;

if ( fields.fieldOrigin( *attIt ) != QgsFields::OriginJoin )
continue;

Expand Down

0 comments on commit 4df00a8

Please sign in to comment.