瀏覽代碼

Don't throw exception if name is null

crobibero 4 年之前
父節點
當前提交
78551d166a
共有 1 個文件被更改,包括 5 次插入0 次删除
  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++)
             {