mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Resolve a System.IndexOutOfRangeException when requesting IDs that do not exist via /Users/.../Items. Previously it was possible for the 'index' values in 'positions' to refer beyond 'size'.
[ERR] Error processing request. URL "GET" "/Users/.../Items". System.IndexOutOfRangeException: Index was outside the bounds of the array. at MediaBrowser.Controller.Entities.Folder.SortItemsByRequest(InternalItemsQuery query, IReadOnlyList`1 items) at MediaBrowser.Controller.Entities.Folder.GetItems(InternalItemsQuery query) at Jellyfin.Api.Controllers.ItemsController.GetItems
This commit is contained in:
parent
f9dffa767f
commit
3bd2cc9860
@ -901,7 +901,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
for (int i = 0; i < ids.Length; i++)
|
for (int i = 0; i < ids.Length; i++)
|
||||||
{
|
{
|
||||||
if (positions.TryAdd(ids[i], index))
|
if (items.Any(item => item.Id == ids[i]) && positions.TryAdd(ids[i], index))
|
||||||
{
|
{
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user