Try to fix postgres provider handling of missing attributes

This commit is contained in:
Nyall Dawson 2018-02-17 17:09:19 +10:00
parent 877efca82e
commit 84d2443b0a

View File

@ -2158,7 +2158,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )
for ( int i = 0; i < fieldId.size(); i++ )
{
int attrIdx = fieldId[i];
QVariant value = attrs.at( attrIdx );
QVariant value = attrIdx < attrs.length() ? attrs.at( attrIdx ) : QVariant( QVariant::Int );
QString v;
if ( value.isNull() )