mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-23 21:47:14 -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
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…
Add table
Add a link
Reference in a new issue