Add check so nulls will result in valid sort

This commit is contained in:
Joe Rogers
2022-04-03 22:50:32 +02:00
parent 1d585146d6
commit 0674f84e9e
4 changed files with 109 additions and 0 deletions

View File

@@ -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;