[Analyzer] Fix introduced regression: properly check for nullable attribute.

llvm-svn: 315492
This commit is contained in:
George Karpenkov 2017-10-11 19:13:15 +00:00
parent 5acfd1dd78
commit 734cad8790
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}