Skip to content
Permalink
Browse files

Fix spatialite crash on field added

Fixes #34375

Add a check for the field index validity, but the issue was really
an undesired side effect of the spaghetti-signal-slot hell.
  • Loading branch information
elpaso authored and nyalldawson committed Feb 12, 2020
1 parent 1c53c77 commit 2024fb568399c65bf1e7d44bec45a817f4b4007c
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -1024,6 +1024,11 @@ QVariant QgsSpatiaLiteProvider::defaultValue( int fieldId ) const

QString QgsSpatiaLiteProvider::defaultValueClause( int fieldIndex ) const
{
if ( ! mAttributeFields.exists( fieldIndex ) )
{
return QString();
}

if ( mAttributeFields.at( fieldIndex ).name() == mPrimaryKey && mPrimaryKeyAutoIncrement )
{
return tr( "Autogenerate" );

0 comments on commit 2024fb5

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