diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java index 90c6fbb7ee13..df86eee27b19 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java @@ -32,6 +32,7 @@ import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; import com.intellij.psi.search.searches.AllOverridingMethodsSearch; import com.intellij.psi.search.searches.ClassInheritorsSearch; @@ -181,6 +182,10 @@ public class JavaLineMarkerProvider implements LineMarkerProvider, DumbAware { private static boolean isRecursiveMethodCall(@NotNull PsiMethodCallExpression methodCall){ final PsiMethod referencedMethod = (PsiMethod)methodCall.getMethodExpression().resolve(); + if (referencedMethod == null){ + return false; + } + return referencedMethod.getTextRange().contains(methodCall.getTextRange()); }