diff options
-rw-r--r-- | tools/CIndex/CIndex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 6221a615aa..f9f735113f 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -1296,9 +1296,9 @@ CXSourceLocation clang_getLocation(CXTranslationUnit tu, CXFile file, unsigned line, unsigned column) { - if (!tu) + if (!tu || !file) return clang_getNullLocation(); - + ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu); SourceLocation SLoc = CXXUnit->getSourceManager().getLocation( |