Add null pointer check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68281 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 5047e71..7637a16 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -789,7 +789,8 @@
if (const Stmt *PS = PrevLoc.asStmt())
if (const Stmt *NS = NewLoc.asStmt()) {
const Stmt *parentPS = PDB.getParent(PS);
- if (isa<CompoundStmt>(parentPS) && parentPS == PDB.getParent(NS))
+ if (parentPS && isa<CompoundStmt>(parentPS) &&
+ parentPS == PDB.getParent(NS))
return;
}