ICore: Fix possible crash in raiseWindow()

Don't call else branch with nullptr when window is nullptr.

Amends 79be19a8a0

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

View File

@@ -720,7 +720,9 @@ void ICore::raiseWindow(QWidget *widget)
if (!widget)
return;
QWidget *window = widget->window();
if (window && window == m_mainwindow) {
if (!window)
return;
if (window == m_mainwindow) {
m_mainwindow->raiseWindow();
} else {
window->raise();