mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -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
|
||||
*/
|
||||
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)) {
|
||||
|
||||
throw new IllegalArgumentException("");
|
||||
}
|
||||
|
||||
TAbstractSet.counter = 1;
|
||||
|
||||
return new TPattern().compileImpl(pattern, flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user