From 6897a1905149134499a5b199b66f0f68a5e3882f Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sun, 22 Mar 2020 15:09:51 +0100 Subject: [PATCH] Add missing null check when retrieving extras --- MediaBrowser.Controller/Entities/BaseItem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 623262407..a9ec19e2f 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -178,6 +178,7 @@ namespace MediaBrowser.Controller.Entities [JsonIgnore] public int? TotalBitrate { get; set; } + [JsonIgnore] public ExtraType? ExtraType { get; set; } @@ -2884,7 +2885,7 @@ namespace MediaBrowser.Controller.Entities public IEnumerable GetExtras(IReadOnlyCollection extraTypes) { - return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null && extraTypes.Contains(i.ExtraType.Value)); + return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i?.ExtraType != null && extraTypes.Contains(i.ExtraType.Value)); } public IEnumerable GetTrailers()