File tree Expand file tree Collapse file tree
src/main/java/org/mvplugins/multiverse/core/utils/matcher Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .mvplugins .multiverse .core .utils .matcher ;
22
3+ import com .dumptruckman .minecraft .util .Logging ;
4+ import io .vavr .control .Try ;
35import org .jetbrains .annotations .ApiStatus ;
46
57import java .util .regex .Pattern ;
@@ -27,7 +29,10 @@ public class WildcardStringMatcher implements StringMatcher {
2729 @ ApiStatus .AvailableSince ("5.2" )
2830 public WildcardStringMatcher (String wildcard ) {
2931 this .wildcard = wildcard ;
30- this .pattern = Pattern .compile (("\\ Q" + wildcard + "\\ E" ).replace ("*" , "\\ E.*\\ Q" ));
32+ this .pattern = Try .of (() -> Pattern .compile (("\\ Q" + wildcard + "\\ E" ).replace ("*" , "\\ E.*\\ Q" )))
33+ .onFailure (ex -> Logging .warning ("Failed to compile wildcard '%s': %s" ,
34+ wildcard , ex .getMessage ()))
35+ .getOrNull ();
3136 }
3237
3338 /**
You can’t perform that action at this time.
0 commit comments