Skip to content

Commit

Permalink
Update src/app/qgsfeatureaction.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
  • Loading branch information
2 people authored and nyalldawson committed Jun 14, 2021
1 parent 236322d commit 7efef38
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/qgsfeatureaction.cpp
Expand Up @@ -191,7 +191,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] );
}
}
Expand Down Expand Up @@ -325,4 +325,3 @@ QgsFeature QgsFeatureAction::feature() const
{
return mFeature ? *mFeature : QgsFeature();
}

0 comments on commit 7efef38

Please sign in to comment.