Explorar o código

Don't throw exception if name is null

crobibero %!s(int64=4) %!d(string=hai) anos
pai
achega
78551d166a
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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++)
             {