Skip to content

Commit 41e1c4a

Browse files
810: Fixed StringIndexOutOfBoundsException during UCT inspection via action execution
1 parent a2d1306 commit 41e1c4a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/com/magento/idea/magento2uct/util/php/MagentoTypeEscapeUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ private MagentoTypeEscapeUtil() {
3232
String result = typeFqn;
3333

3434
while (matcher.find()) {
35-
result = result.substring(0, matcher.start(0)) + result.substring(matcher.end(0));
35+
final int begin = matcher.start(0);
36+
final int end = matcher.end(0);
37+
38+
if (begin < 0 || begin > end || end > result.length()) {
39+
continue;
40+
}
41+
result = result.substring(0, begin) + result.substring(end);
3642
}
3743

3844
return typeFqn.equals(result) ? typeFqn : result;

0 commit comments

Comments
 (0)