Project wizards: Fix project node assertion

Change-Id: I864139747ee6b5e7cb1ac4d59d2b11219750ddde
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-06-19 15:31:07 +02:00
parent c03c77b9c4
commit 77c90f0856

View File

@@ -499,8 +499,13 @@ void JsonWizard::openProjectForNode(Node *node)
{
using namespace Utils;
ProjectNode *projNode = node->asProjectNode() ? node->asProjectNode() : node->parentProjectNode();
const ProjectNode *projNode = node->asProjectNode();
if (!projNode) {
if (ContainerNode * const cn = node->asContainerNode())
projNode = cn->rootProjectNode();
else
projNode = node->parentProjectNode();
}
QTC_ASSERT(projNode, return);
Utils::optional<FilePath> projFilePath = projNode->visibleAfterAddFileAction();