diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java index e8dcf653f..b636dac46 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java @@ -22,6 +22,7 @@ import org.teavm.classlib.java.util.TArrays; import org.teavm.classlib.java.util.TComparator; import org.teavm.classlib.java.util.THashMap; import org.teavm.classlib.java.util.TMap; +import org.teavm.classlib.java.util.regex.TPattern; import org.teavm.dependency.PluggableDependency; import org.teavm.javascript.ni.InjectedBy; import org.teavm.javascript.ni.Rename; @@ -613,4 +614,16 @@ public class TString extends TObject implements TSerializable, TComparable matchResult.groupCount()) { + throw new IndexOutOfBoundsException("Index " + group + " if out of range [0; " + + matchResult.groupCount() + ")"); + } return matchResult.group(group); }