From b315e9e9ea5ae265f953b59c5eeaa0df02d1117c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 28 Apr 2014 04:31:10 +0000 Subject: [PATCH] * allow null parameter --- source/net/filebot/format/ExpressionFormatMethods.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index 264412fd..64d76e56 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -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) { + if (pattern == null) + return null; + Matcher matcher = compile(pattern, CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self); return matcher.find() ? matcher.reset() : null; }