Skip to content
Permalink
Browse files

[spatialite] Fix crash with a subset of attributes request for joined…

… field
  • Loading branch information
m-kuhn committed Oct 10, 2013
1 parent 5e14fea commit e32930d42c2e706f38c37879b4366978cb964c2f
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
@@ -321,8 +321,19 @@ bool QgsSpatiaLiteFeatureIterator::getFeature( sqlite3_stmt *stmt, QgsFeature &f
}
else
{
int attrIndex = subsetAttributes ? mRequest.subsetOfAttributes()[ic-1] : ic - 1;
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, P->attributeFields[attrIndex].type() ) );
if ( subsetAttributes )
{
if ( mRequest.subsetOfAttributes().contains( ic - 1 ) )
{
int attrIndex = mRequest.subsetOfAttributes()[ic-1];
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, P->attributeFields[attrIndex].type() ) );
}
}
else
{
int attrIndex = subsetAttributes ? mRequest.subsetOfAttributes()[ic-1] : ic - 1;
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, P->attributeFields[attrIndex].type() ) );
}
}
}

0 comments on commit e32930d

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