mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 07:10:45 +00:00
Add check so nulls will result in valid sort
This commit is contained in:
parent
1d585146d6
commit
0674f84e9e
4 changed files with 109 additions and 0 deletions
|
|
@ -34,6 +34,11 @@ namespace Emby.Server.Implementations.Sorting
|
|||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
|
||||
if (!x.IndexNumber.HasValue && !y.IndexNumber.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!x.IndexNumber.HasValue)
|
||||
{
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ namespace Emby.Server.Implementations.Sorting
|
|||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
|
||||
if (!x.ParentIndexNumber.HasValue && !y.ParentIndexNumber.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!x.ParentIndexNumber.HasValue)
|
||||
{
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue