QmlPreview: Fix crash at shutdown

Seem like it get a nullptr project at shutdown.

Change-Id: I76d9f4b2b90b0641d645cb413f9ebfe678bb1c9f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2020-08-10 13:49:58 +02:00
parent e43c7fdb1d
commit 208ebd6043

View File

@@ -115,7 +115,10 @@ ProjectFileSelectionsWidget::ProjectFileSelectionsWidget(const QString &projectS
layout->setContentsMargins(0, 0, 0, 0);
layout->addLayout(viewLayout);
auto initModel = [this, model, updateCheckedFiles] (ProjectExplorer::Project *project) {
auto initModel = [this, model, updateCheckedFiles](ProjectExplorer::Project *project) {
if (!project)
return;
auto refreshModel = [this, model, updateCheckedFiles] () {
model->clear();
if (auto project = ProjectExplorer::SessionManager::startupProject()) {