We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15241a9 commit b83b53dCopy full SHA for b83b53d
sources/net.sf.j2s.java.core/src/java/util/regex/Matcher.java
@@ -953,7 +953,9 @@ public String group(int group) {
953
throw new IllegalStateException("No match found");
954
if (group < 0 || group > groupCount())
955
throw new IndexOutOfBoundsException("No group " + group);
956
- return results[group];
+ // this array is coming from JavaScript RegExp; some values may be "undefined"
957
+ // so we force them to be null.
958
+ return results[group] == null ? null : results[group];
959
// if ((groups[group*2] == -1) || (groups[group*2+1] == -1))
960
// return null;
961
// return getSubSequence(groups[group * 2], groups[group * 2 + 1]).toString();
0 commit comments