From 6ad94460869fbe8a9e66f45af7b309b8d2338879 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 17 Dec 2018 13:16:11 +0100 Subject: [PATCH] ProjectManager: Fix Project::findNodeForBuildKey() Amends c58da42babe50. This operates also on not-fully loaded projects now, which was previously causing a crash on android projects. Change-Id: I44eeb7af8ed53a47ef39e7f1bafb07b871879ce5 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/project.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 2225b026d18..1bb7308aba8 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -886,9 +886,11 @@ bool Project::hasParsingData() const const ProjectNode *Project::findNodeForBuildKey(const QString &buildKey) const { const ProjectNode *result = nullptr; - d->m_rootProjectNode->forEachProjectNode([buildKey](const ProjectNode *node) { - return node->buildKey() == buildKey; - }); + if (d->m_rootProjectNode) { + d->m_rootProjectNode->forEachProjectNode([buildKey](const ProjectNode *node) { + return node->buildKey() == buildKey; + }); + } return result; }