Merge pull request #4643 from crobibero/empty-lib-null-ref
Fix null reference when getting filters of an empty library
This commit is contained in:
commit
1d3b2e8dd6
|
@ -83,7 +83,12 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var itemList = ((Folder)item!).GetItemList(query);
|
if (item is not Folder folder)
|
||||||
|
{
|
||||||
|
return new QueryFiltersLegacy();
|
||||||
|
}
|
||||||
|
|
||||||
|
var itemList = folder.GetItemList(query);
|
||||||
return new QueryFiltersLegacy
|
return new QueryFiltersLegacy
|
||||||
{
|
{
|
||||||
Years = itemList.Select(i => i.ProductionYear ?? -1)
|
Years = itemList.Select(i => i.ProductionYear ?? -1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user