From f45baa9dbef1d4b607b4596208190dc177ad615a Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Fri, 3 Oct 2014 17:40:24 +0400 Subject: [PATCH] Fix EA-60953 - NPE: CodeInsightUtils.findElementsOfClassInRange --- .../org/jetbrains/jet/plugin/codeInsight/CodeInsightUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/CodeInsightUtils.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/CodeInsightUtils.java index 6424612dbb3..65275a2e979 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/CodeInsightUtils.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/CodeInsightUtils.java @@ -144,7 +144,7 @@ public class CodeInsightUtils { PsiElement stopElement = element2.getNextSibling(); List array = new ArrayList(); - for (PsiElement currentElement = element1; currentElement != stopElement; currentElement = currentElement.getNextSibling()) { + for (PsiElement currentElement = element1; currentElement != stopElement && currentElement != null; currentElement = currentElement.getNextSibling()) { if (aClass.isInstance(currentElement)) { array.add(currentElement); }