aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-04-04 06:30:24 -0600
committercrobibero <cody@robibe.ro>2022-04-07 12:54:58 -0400
commit04cac23a11cacb750a73c65d1dc54c01504626b0 (patch)
tree41c975df87054f1a21230de885eba3059ad2e56a /Emby.Server.Implementations/Sorting
parent1425ef3cb4fcb7272917c9cacbc8d1915cd245b7 (diff)
Merge pull request #7548 from 1337joe/comparer-null-fix
(cherry picked from commit 72aca1519132315a69d9dad53e4840f461e58285) Signed-off-by: crobibero <cody@robibe.ro>
Diffstat (limited to 'Emby.Server.Implementations/Sorting')
-rw-r--r--Emby.Server.Implementations/Sorting/IndexNumberComparer.cs5
-rw-r--r--Emby.Server.Implementations/Sorting/ParentIndexNumberComparer.cs5
2 files changed, 10 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Sorting/IndexNumberComparer.cs b/Emby.Server.Implementations/Sorting/IndexNumberComparer.cs
index e39280a10..c5b00afb1 100644
--- a/Emby.Server.Implementations/Sorting/IndexNumberComparer.cs
+++ b/Emby.Server.Implementations/Sorting/IndexNumberComparer.cs
@@ -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;
diff --git a/Emby.Server.Implementations/Sorting/ParentIndexNumberComparer.cs b/Emby.Server.Implementations/Sorting/ParentIndexNumberComparer.cs
index ffc4e0cad..8c408bb4d 100644
--- a/Emby.Server.Implementations/Sorting/ParentIndexNumberComparer.cs
+++ b/Emby.Server.Implementations/Sorting/ParentIndexNumberComparer.cs
@@ -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;