Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the previous commit.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138762 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
index 1c93902..76d9287 100644
--- a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
@@ -203,7 +203,7 @@
     // region, if that is the case, get the underlining region.
     if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
       R = ER->getAsArrayOffset().getRegion();
-      if (!isa<SymbolicRegion>(R))
+      if (!R || !isa<SymbolicRegion>(R))
         return 0;
     } else
       return 0;