Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Try to fix postgres provider handling of missing attributes
  • Loading branch information
nyalldawson committed Feb 17, 2018
1 parent 877efca commit 84d2443
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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() )
Expand Down

0 comments on commit 84d2443

Please sign in to comment.