Skip to content

Commit 49be8d4

Browse files
Merge pull request #1018 from Iamwade/1000-fixed-bug-report
1000: Fixed ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5(GetModuleNameByDirectoryUtil.java:47)
2 parents e4be0b9 + bd79e8c commit 49be8d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/com/magento/idea/magento2plugin/util/magento/GetModuleNameByDirectoryUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ private GetModuleNameByDirectoryUtil() {}
4444
final String moduleNamePath = matcher.group(0);
4545

4646
if (!moduleNamePath.isEmpty()) {
47-
return moduleNamePath.split("/")[5];
47+
final String[] moduleNamePathParts = moduleNamePath.split("/");
48+
49+
if (moduleNamePathParts.length >= 6) { //NOPMD
50+
return moduleNamePath.split("/")[5];
51+
}
4852
}
4953
}
5054

0 commit comments

Comments
 (0)