File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3640,12 +3640,17 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
3640
3640
3641
3641
QVariant::Type type = attributeFields[i].type ();
3642
3642
3643
- if ( type == QVariant::Int )
3643
+ if ( v.isNull () )
3644
+ {
3645
+ // binding a NULL value
3646
+ sqlite3_bind_null ( stmt, ++ia );
3647
+ }
3648
+ else if ( type == QVariant::Int )
3644
3649
{
3645
3650
// binding an INTEGER value
3646
3651
sqlite3_bind_int ( stmt, ++ia, v.toInt () );
3647
3652
}
3648
- if ( type == QVariant::LongLong )
3653
+ else if ( type == QVariant::LongLong )
3649
3654
{
3650
3655
// binding a LONGLONG value
3651
3656
sqlite3_bind_int64 ( stmt, ++ia, v.toLongLong () );
@@ -3663,7 +3668,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
3663
3668
}
3664
3669
else
3665
3670
{
3666
- // binding a NULL value
3671
+ // Unknown type: bind a NULL value
3667
3672
sqlite3_bind_null ( stmt, ++ia );
3668
3673
}
3669
3674
}
You can’t perform that action at this time.
0 commit comments