ProjectManager: Fix Project::findNodeForBuildKey()

Amends c58da42bab.

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 <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-12-17 13:16:11 +01:00
parent c1d6562d2e
commit 6ad9446086

View File

@@ -886,9 +886,11 @@ bool Project::hasParsingData() const
const ProjectNode *Project::findNodeForBuildKey(const QString &buildKey) const const ProjectNode *Project::findNodeForBuildKey(const QString &buildKey) const
{ {
const ProjectNode *result = nullptr; const ProjectNode *result = nullptr;
d->m_rootProjectNode->forEachProjectNode([buildKey](const ProjectNode *node) { if (d->m_rootProjectNode) {
return node->buildKey() == buildKey; d->m_rootProjectNode->forEachProjectNode([buildKey](const ProjectNode *node) {
}); return node->buildKey() == buildKey;
});
}
return result; return result;
} }