Skip to content

Commit 84d2443

Browse files
committedFeb 17, 2018
Try to fix postgres provider handling of missing attributes
1 parent 877efca commit 84d2443

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )
21582158
for ( int i = 0; i < fieldId.size(); i++ )
21592159
{
21602160
int attrIdx = fieldId[i];
2161-
QVariant value = attrs.at( attrIdx );
2161+
QVariant value = attrIdx < attrs.length() ? attrs.at( attrIdx ) : QVariant( QVariant::Int );
21622162

21632163
QString v;
21642164
if ( value.isNull() )

0 commit comments

Comments
 (0)
Please sign in to comment.