Skip to content

Commit c8388e2

Browse files
committed
Fixed Haehnchen#1640: Go to declaration throws ArrayIndexOutOfBoundsException on empty class const name
1 parent 9fe4296 commit c8388e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/dic/container/util/ServiceContainerUtil.java

+5
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,11 @@ public static Collection<PsiElement> getTargetsForConstant(@NotNull Project proj
731731
contents = contents.replaceAll(":+", ":");
732732
String[] split = contents.split(":");
733733

734+
if (split.length < 2) {
735+
// Empty const name e.g. "\\App\\Foo::"
736+
return Collections.emptyList();
737+
}
738+
734739
Collection<PsiElement> psiElements = new ArrayList<>();
735740
for (PhpClass phpClass : PhpElementsUtil.getClassesInterface(project, split[0])) {
736741
Field fieldByName = phpClass.findFieldByName(split[1], true);

0 commit comments

Comments
 (0)