Skip to content

Commit 03a8523

Browse files
authored
[T3CMS] Prevent ArrayOutOfBoundsException on WSL when indexing translations (#343)
1 parent d7ded58 commit 03a8523

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

typo3-cms/src/main/java/com/cedricziel/idea/typo3/index/TranslationIndex.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ private static String[] compileIds(VirtualFile file, String extensionKeyFromFile
135135
}
136136

137137
String path = file.getPath();
138-
String filePosition = extensionKeyFromFile + path.split(extensionRootFolder.getPath())[1];
138+
final String[] splitByExtensionFolder = path.split(extensionRootFolder.getPath());
139+
if (splitByExtensionFolder.length < 2) {
140+
throw new FileNotFoundException("The path given does not match the path expected.");
141+
}
142+
143+
String filePosition = extensionKeyFromFile + splitByExtensionFolder[1];
139144

140145
if (!languageKey.equals("en")) {
141146
filePosition = filePosition.replace(languageKey + ".", "");

0 commit comments

Comments
 (0)