Commit c09ddbc7 authored by Milian Wolff's avatar Milian Wolff
Browse files

Don't crash later when we try to parse a non-existing file.

In such cases, the path is empty and we assert on the validity of
the path elsewhere.
parent bb7b0cf3
......@@ -122,6 +122,10 @@ ReferencedTopDUContext ClangHelpers::buildDUChain(CXFile file, const Imports& im
}
const IndexedString path(QDir(ClangString(clang_getFileName(file)).toString()).canonicalPath());
if (path.isEmpty()) {
// may happen when the file gets removed before the job is run
return {};
}
const auto& environment = session.environment();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment