Skip to content
Permalink
Browse files

Fix loss of checkbox widget settings when a default expression is set

Fixes #18076
  • Loading branch information
nyalldawson committed Feb 12, 2018
1 parent efdaf5f commit 0eda77661fcef96b795eb451f5e73e9b4b0a2613
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/app/qgsattributetypedialog.cpp
@@ -132,7 +132,7 @@ const QVariantMap QgsAttributeTypeDialog::editorWidgetConfig()
if ( item )
{
QString widgetType = item->data( Qt::UserRole ).toString();
QgsEditorConfigWidget *cfgWdg = mEditorConfigWidgets[ widgetType ];
QgsEditorConfigWidget *cfgWdg = mEditorConfigWidgets.value( widgetType );
if ( cfgWdg )
{
return cfgWdg->config();
@@ -147,7 +147,7 @@ void QgsAttributeTypeDialog::setEditorWidgetType( const QString &type )

mWidgetTypeComboBox->setCurrentIndex( mWidgetTypeComboBox->findData( type ) );

if ( mEditorConfigWidgets.contains( type ) )
if ( mEditorConfigWidgets.contains( type ) && mEditorConfigWidgets.value( type ) /* may be a null pointer */ )
{
stackedWidget->setCurrentWidget( mEditorConfigWidgets[type] );
}

0 comments on commit 0eda776

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