Add missing null check when retrieving extras

This commit is contained in:
Mark Monteiro 2020-03-22 15:09:51 +01:00
parent 2184553d15
commit 6897a19051

View File

@ -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<BaseItem> GetExtras(IReadOnlyCollection<ExtraType> 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<BaseItem> GetTrailers()