Fix crash

If the StudioWelcomePage is used, then SessionPage
is not created and m_projectModel is initialized in the
constructor of SessionPage.

Task-numnber: QDS-6332
Change-Id: If64bfcb42bc2616d68456aa08bb4c03a4f9e15f1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2022-02-25 09:32:27 +01:00
parent d0eb2c7428
commit e7b9c3cdde

View File

@@ -142,6 +142,7 @@ ProjectWelcomePage::ProjectWelcomePage()
cmd = ActionManager::registerAction(act, projectBase.withSuffix(i), welcomeContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+%1").arg(i)));
connect(act, &QAction::triggered, this, [this, i] {
QTC_ASSERT(m_projectModel, return);
if (i <= m_projectModel->rowCount(QModelIndex()))
openProjectAt(i - 1);
});