From 6b781b4fe9ea80b6ff2ccd7333bf8ae82e43d03d Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 10 May 2022 13:14:14 +0200 Subject: [PATCH] CMakePM: Fix crash when file system progress bar was cancelled If the user cancelled the file system progress bar, the the m_allFiles will be null and shouldn't be used. Fixes: QTCREATORBUG-27499 Change-Id: I92c509f1e66d0968f921ec103fd81631eed9ab38 Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 99cb43eab40..e89878a6b30 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -702,7 +702,8 @@ void CMakeBuildSystem::updateFileSystemNodes() addCMakeLists(newRoot.get(), std::move(fileNodes)); } - addFileSystemNodes(newRoot.get(), m_allFiles); + if (m_allFiles) + addFileSystemNodes(newRoot.get(), m_allFiles); setRootProjectNode(std::move(newRoot)); m_reader.resetData();