mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02: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
1 changed files with 1 additions and 1 deletions
|
@ -901,7 +901,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
int index = 0;
|
||||
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++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue