Gui: Avoid segfault if window is not an MDIView

Fixes #10003. See also #9758.
This commit is contained in:
Oliver Oxtoby
2023-07-28 09:32:00 +02:00
committed by 0penBrain
parent 2a1d4d4994
commit ba5f7e6d75

View File

@@ -1170,9 +1170,12 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w)
auto view = dynamic_cast<MDIView*>(w->widget());
// set active the appropriate window (it needs not to be part of mdiIds, e.g. directly after creation)
d->activeView = view;
Application::Instance->viewActivated(view);
if (view)
{
d->activeView = view;
Application::Instance->viewActivated(view);
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
bool saveWB = hGrp->GetBool("SaveWBbyTab", false);
if (saveWB) {