Fix EA-60953 - NPE: CodeInsightUtils.findElementsOfClassInRange
This commit is contained in:
@@ -144,7 +144,7 @@ public class CodeInsightUtils {
|
|||||||
|
|
||||||
PsiElement stopElement = element2.getNextSibling();
|
PsiElement stopElement = element2.getNextSibling();
|
||||||
List<PsiElement> array = new ArrayList<PsiElement>();
|
List<PsiElement> array = new ArrayList<PsiElement>();
|
||||||
for (PsiElement currentElement = element1; currentElement != stopElement; currentElement = currentElement.getNextSibling()) {
|
for (PsiElement currentElement = element1; currentElement != stopElement && currentElement != null; currentElement = currentElement.getNextSibling()) {
|
||||||
if (aClass.isInstance(currentElement)) {
|
if (aClass.isInstance(currentElement)) {
|
||||||
array.add(currentElement);
|
array.add(currentElement);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user