fix HardcodedContracts NPE
authorpeter <peter@jetbrains.com>
Mon, 19 Jan 2015 10:16:51 +0000 (11:16 +0100)
committerpeter <peter@jetbrains.com>
Mon, 19 Jan 2015 10:22:56 +0000 (11:22 +0100)
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/HardcodedContracts.java

index 05743b52c137450bbb1036d2a1faa2683f3b9926..1fb320e6eda0ec1b75f61dcbf0a30872765dbea2 100644 (file)
@@ -171,7 +171,8 @@ public class HardcodedContracts {
     }
 
     if (element instanceof PsiParameter) {
-      return hasHardcodedContracts(element.getParent().getParent());
+      PsiElement parent = element.getParent();
+      return parent != null && hasHardcodedContracts(parent.getParent());
     }
 
     return false;