InfoBar: Ensure we don't access nullptr

Change-Id: I4bd7019ea424c04cc1f1e130d76033175ac3a5bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-11-30 14:36:14 +01:00
parent c37ee615a6
commit 1755f208fb

View File

@@ -374,8 +374,10 @@ void InfoBarDisplay::update()
if (infoWidgetCloseButton) if (infoWidgetCloseButton)
hbox->addWidget(infoWidgetCloseButton); hbox->addWidget(infoWidgetCloseButton);
} else { } else {
if (infoWidgetCloseButton) {
infoWidgetCloseButton->setText(info.m_cancelButtonText); infoWidgetCloseButton->setText(info.m_cancelButtonText);
hbox->addWidget(infoWidgetCloseButton); hbox->addWidget(infoWidgetCloseButton);
}
if (infoWidgetSuppressButton) if (infoWidgetSuppressButton)
hbox->addWidget(infoWidgetSuppressButton); hbox->addWidget(infoWidgetSuppressButton);
} }