Browse Source

Don't throw exception if name is null

crobibero 4 years ago
parent
commit
78551d166a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Emby.Naming/Video/CleanDateTimeParser.cs

+ 5 - 0
Emby.Naming/Video/CleanDateTimeParser.cs

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