summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 469d782deb3..8a686a7f3d7 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -256,6 +256,8 @@ const FileEntry *HeaderSearch::getFileAndSuggestModule(
// If we have a module map that might map this header, load it and
// check whether we'll have a suggestion for a module.
const FileEntry *File = getFileMgr().getFile(FileName, /*OpenFile=*/true);
+ if (!File)
+ return nullptr;
// If there is a module that corresponds to this header, suggest it.
if (!findUsableModuleForHeader(File, Dir ? Dir : File->getDir(),
OpenPOWER on IntegriCloud