diff options
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp index 47b33045416..516544b0f5c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp @@ -122,7 +122,8 @@ bool NonnullStringConstantsChecker::isStringlike(QualType Ty) const { return true; if (auto *T = dyn_cast<ObjCObjectPointerType>(Ty)) { - return T->getInterfaceDecl()->getIdentifier() == NSStringII; + return T->getInterfaceDecl() && + T->getInterfaceDecl()->getIdentifier() == NSStringII; } else if (auto *T = dyn_cast<TypedefType>(Ty)) { return T->getDecl()->getIdentifier() == CFStringRefII; } |

