diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index 40988f11..f23ab8af 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -289,7 +289,17 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist."); } } - return utility::getTopLevelPaths(indexedHeaderPaths); + + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCodeblocksProject( @@ -319,7 +329,17 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist."); } } - return utility::getTopLevelPaths(indexedHeaderPaths); + + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCDB( @@ -348,7 +368,16 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths } } - return utility::getTopLevelPaths(indexedHeaderPaths); + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } QtProjectWizzardContentIndexedHeaderPaths::QtProjectWizzardContentIndexedHeaderPaths(