aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs')
-rw-r--r--Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs12
1 files changed, 3 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
index a81f78ebf..ce44f99a6 100644
--- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
+++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
@@ -31,15 +31,9 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem? x, BaseItem? y)
{
- if (x == null)
- {
- throw new ArgumentNullException(nameof(x));
- }
-
- if (y == null)
- {
- throw new ArgumentNullException(nameof(y));
- }
+ ArgumentNullException.ThrowIfNull(x);
+
+ ArgumentNullException.ThrowIfNull(y);
var levelX = string.IsNullOrEmpty(x.OfficialRating) ? 0 : _localization.GetRatingLevel(x.OfficialRating) ?? 0;
var levelY = string.IsNullOrEmpty(y.OfficialRating) ? 0 : _localization.GetRatingLevel(y.OfficialRating) ?? 0;