Fix null reference when getting filters of an empty library
This commit is contained in:
parent
3b4f86579b
commit
41e127d1d2
|
@ -92,7 +92,12 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var itemList = ((Folder)item!).GetItemList(query);
|
var itemList = ((Folder?)item)?.GetItemList(query);
|
||||||
|
if (itemList == null)
|
||||||
|
{
|
||||||
|
return new QueryFiltersLegacy();
|
||||||
|
}
|
||||||
|
|
||||||
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