sometimes filter is null and I don't know why

This commit is contained in:
Michael Becker 2020-10-12 22:19:59 -04:00
parent 3a2711c70a
commit ae57bf7276
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -798,6 +798,9 @@ namespace UniversalEditor
}
public static bool Match(this string input, string filter)
{
if (filter == null)
return false;
string wildcardToRegex = "^" + System.Text.RegularExpressions.Regex.Escape(filter).Replace("\\*", ".*").Replace("\\?", ".") + "$";
return new System.Text.RegularExpressions.Regex(wildcardToRegex).IsMatch(input);
}