From 2a2a2a6ed26d7b1f57a829303b0f9c16375a0b52 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 18 Mar 2019 17:15:23 +0100 Subject: [PATCH] ProjectExplorer: Add the usual reparsing guards to addExistingProjects() Change-Id: I5791007200004a12d3b8bc327ed17304c01d508b Reviewed-by: hjk --- src/plugins/projectexplorer/projectexplorer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index f079df2cb9e..75051a4ce34 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3355,7 +3355,8 @@ void ProjectExplorerPluginPrivate::addNewSubproject() void ProjectExplorerPluginPrivate::addExistingProjects() { Node * const currentNode = ProjectTree::findCurrentNode(); - QTC_ASSERT(currentNode, return); + if (!currentNode) + return; ProjectNode *projectNode = currentNode->asProjectNode(); if (!projectNode && currentNode->asContainerNode()) projectNode = currentNode->asContainerNode()->rootProjectNode(); @@ -3364,6 +3365,8 @@ void ProjectExplorerPluginPrivate::addExistingProjects() QStringList subProjectFilePaths = QFileDialog::getOpenFileNames( ICore::mainWindow(), tr("Please choose a project file"), dir, projectNode->subProjectFileNamePatterns().join(";;")); + if (!ProjectTree::hasNode(projectNode)) + return; const QList childNodes = projectNode->nodes(); Utils::erase(subProjectFilePaths, [childNodes](const QString &filePath) { return Utils::anyOf(childNodes, [filePath](const Node *n) {