diff options
author | hjk <hjk@qt.io> | 2018-03-19 13:01:57 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-03-19 12:48:36 +0000 |
commit | 1e033d8a085ba7373359c84f4afed37c52c5b27e (patch) | |
tree | 538fa33db6266f2323abd4081f41c4a76d132e7e /src/plugins | |
parent | 7ba225cb79c2d83bf7ed5dd249747541dd27a963 (diff) | |
download | qt-creator-1e033d8a085ba7373359c84f4afed37c52c5b27e.tar.gz |
ProjectExplorer: Prevent crash on project closing
Introduced with e20d6200436d, currentProject will be null when
a project gets closed. The previous code path had access to a
locally cached and still valid pointer to the project that's
about to be closed.
Change-Id: I3260b4ed1ac325fc2be0e8bba934d7888b1d698c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 4c632abf8b..ee85d8c6a4 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2968,9 +2968,9 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() else pn = const_cast<ProjectNode*>(currentNode->asProjectNode()); - if (pn) { - Project *project = ProjectTree::currentProject(); - if (project && pn == project->rootProjectNode()) { + Project *project = ProjectTree::currentProject(); + if (pn && project) { + if (pn == project->rootProjectNode()) { m_runActionContextMenu->setVisible(true); } else { QList<RunConfiguration *> runConfigs; |