Skip to content
Permalink
Browse files
Update src/app/qgsfeatureaction.cpp
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
  • Loading branch information
2 people authored and nyalldawson committed Jun 7, 2021
1 parent 33ccb0b commit c4c7ec2495fd9cb05e5a3d85011b47532ca1f074
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/app/qgsfeatureaction.cpp
@@ -189,7 +189,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap &defaultAttributes, boo
{
// Only set initial attribute value if it's different from the default clause or we may trigger
// unique constraint checks for no reason, see https://github.com/qgis/QGIS/issues/42909
if ( mLayer->dataProvider()->defaultValueClause( idx ) != ( *sLastUsedValues() )[ mLayer ][idx] )
if ( mLayer->dataProvider() && mLayer->dataProvider()->defaultValueClause( idx ) != ( *sLastUsedValues() )[ mLayer ][idx] )
initialAttributeValues.insert( idx, ( *sLastUsedValues() )[ mLayer ][idx] );
}
}
@@ -318,4 +318,3 @@ QgsFeature QgsFeatureAction::feature() const
{
return mFeature ? *mFeature : QgsFeature();
}

0 comments on commit c4c7ec2

Please sign in to comment.