Don't throw exception if name is null

This commit is contained in:
crobibero 2020-11-09 06:10:16 -07:00
parent 363d41f943
commit 78551d166a

View File

@ -15,6 +15,11 @@ namespace Emby.Naming.Video
public static CleanDateTimeResult Clean(string name, IReadOnlyList<Regex> cleanDateTimeRegexes) public static CleanDateTimeResult Clean(string name, IReadOnlyList<Regex> cleanDateTimeRegexes)
{ {
CleanDateTimeResult result = new CleanDateTimeResult(name); CleanDateTimeResult result = new CleanDateTimeResult(name);
if (string.IsNullOrEmpty(name))
{
return result;
}
var len = cleanDateTimeRegexes.Count; var len = cleanDateTimeRegexes.Count;
for (int i = 0; i < len; i++) for (int i = 0; i < len; i++)
{ {