mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -08:00
Throw NPE when regex pattern is null
This commit is contained in:
parent
a0493055a8
commit
9902f583bd
|
@ -297,14 +297,13 @@ public final class TPattern implements Serializable {
|
||||||
* @see #UNIX_LINES
|
* @see #UNIX_LINES
|
||||||
*/
|
*/
|
||||||
public static TPattern compile(String pattern, int flags) throws TPatternSyntaxException {
|
public static TPattern compile(String pattern, int flags) throws TPatternSyntaxException {
|
||||||
|
if (pattern == null) {
|
||||||
|
throw new NullPointerException("Patter is null");
|
||||||
|
}
|
||||||
if ((flags != 0) && ((flags | flagsBitMask) != flagsBitMask)) {
|
if ((flags != 0) && ((flags | flagsBitMask) != flagsBitMask)) {
|
||||||
|
|
||||||
throw new IllegalArgumentException("");
|
throw new IllegalArgumentException("");
|
||||||
}
|
}
|
||||||
|
|
||||||
TAbstractSet.counter = 1;
|
TAbstractSet.counter = 1;
|
||||||
|
|
||||||
return new TPattern().compileImpl(pattern, flags);
|
return new TPattern().compileImpl(pattern, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user