Skip to content

Commit 03713ce

Browse files
committed
postgres provider: fix adding features with null values (fixes #11777)
1 parent ba4948e commit 03713ce

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/providers/postgres/qgspostgresprovider.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -1615,9 +1615,6 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
16151615
for ( int idx = 0; idx < attributevec.count(); ++idx )
16161616
{
16171617
QVariant v = attributevec[idx];
1618-
if ( !v.isValid() )
1619-
continue;
1620-
16211618
if ( fieldId.contains( idx ) )
16221619
continue;
16231620

@@ -1638,9 +1635,6 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
16381635
const QgsAttributes &attrs2 = flist[i].attributes();
16391636
QVariant v2 = attrs2[idx];
16401637

1641-
if ( !v2.isValid() )
1642-
break;
1643-
16441638
if ( v2 != v )
16451639
break;
16461640
}
@@ -1731,7 +1725,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
17311725
QVariant value = attrs[ fieldId[i] ];
17321726

17331727
QString v;
1734-
if ( !value.isValid() )
1728+
if ( value.isNull() )
17351729
{
17361730
const QgsField &fld = field( fieldId[i] );
17371731
v = paramValue( defaultValues[i], defaultValues[i] );

0 commit comments

Comments
 (0)