Sfoglia il codice sorgente

Do not assign an invalid value of zero to ExtraType

Mark Monteiro 5 anni fa
parent
commit
ea306e8f6d
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      MediaBrowser.Controller/Entities/BaseItem.cs

+ 3 - 2
MediaBrowser.Controller/Entities/BaseItem.cs

@@ -1327,8 +1327,9 @@ namespace MediaBrowser.Controller.Entities
                         }
 
                         // Use some hackery to get the extra type based on foldername
-                        Enum.TryParse(extraFolderName.Replace(" ", ""), true, out ExtraType extraType);
-                        item.ExtraType = extraType;
+                        item.ExtraType = Enum.TryParse(extraFolderName.Replace(" ", ""), true, out ExtraType extraType)
+                            ? extraType
+                            : (ExtraType?)null;
 
                         return item;