mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 16:58:51 -05:00
* allow null parameter
This commit is contained in:
parent
a8e52145f4
commit
b315e9e9ea
@ -182,9 +182,12 @@ public class ExpressionFormatMethods {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find MatchResult that matches the given pattern (case-insensitive)
|
* Find a matcher that matches the given pattern (case-insensitive)
|
||||||
*/
|
*/
|
||||||
public static Matcher findMatch(String self, String pattern) {
|
public static Matcher findMatch(String self, String pattern) {
|
||||||
|
if (pattern == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);
|
Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self);
|
||||||
return matcher.find() ? matcher.reset() : null;
|
return matcher.find() ? matcher.reset() : null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user