Skip to content
Permalink
Browse files

Skip check if value is NULL

  • Loading branch information
elpaso authored and nyalldawson committed Jun 19, 2020
1 parent f3bbc4d commit fb9de1001669e7b0fb300a0a3f22bb125cfe26e8
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/providers/memory/qgsmemoryprovider.cpp
@@ -419,12 +419,12 @@ bool QgsMemoryProvider::addFeatures( QgsFeatureList &flist, Flags )
continue;
}

// Check attribute types
// Check attribute conversion
bool conversionError { false };
for ( int i = 0; i < mFields.count() && ! conversionError; ++i )
{
QVariant attrValue { it->attribute( i ) };
if ( ! mFields.at( i ).convertCompatible( attrValue ) )
if ( ! attrValue.isNull() && ! mFields.at( i ).convertCompatible( attrValue ) )
{
pushError( tr( "Could not add feature with attribute %1 having type %2, cannot convert to type %3" )
.arg( mFields.at( i ).name(), it->attribute( i ).typeName(), mFields.at( i ).typeName() ) );

0 comments on commit fb9de10

Please sign in to comment.
You can’t perform that action at this time.