Skip to content

Commit

Permalink
Fix loss of checkbox widget settings when a default expression is set
Browse files Browse the repository at this point in the history
Fixes #18076
  • Loading branch information
nyalldawson committed Feb 12, 2018
1 parent efdaf5f commit 0eda776
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsattributetypedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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] );
}
Expand Down

0 comments on commit 0eda776

Please sign in to comment.