diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index bd94fca9b97..31bf0069b9e 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -132,6 +132,7 @@ QWidget *IOptionsPage::widget() if (!m_widget) { if (m_widgetCreator) { m_widget = m_widgetCreator(); + QTC_CHECK(m_widget); } else if (m_settingsProvider) { m_widget = new IOptionsPageWidget; AspectContainer *container = m_settingsProvider(); diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 9a9de241ab4..d4ff3250c4d 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -345,9 +345,12 @@ private: void showEvent(QShowEvent *event) final { if (!widget()) { - QWidget *inner = m_page->widget(); - setWidget(inner); - inner->setAutoFillBackground(false); + if (QWidget *inner = m_page->widget()) { + setWidget(inner); + inner->setAutoFillBackground(false); + } else { + QTC_CHECK(false); + } } QScrollArea::showEvent(event);