diff options
Diffstat (limited to 'Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs')
| -rw-r--r-- | Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs index 3eab4fccc..cd48e3048 100644 --- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs +++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs @@ -2,6 +2,7 @@ using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Querying; +using System; namespace Emby.Server.Implementations.Sorting { @@ -22,6 +23,12 @@ 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)); + var levelX = string.IsNullOrEmpty(x.OfficialRating) ? 0 : _localization.GetRatingLevel(x.OfficialRating) ?? 0; var levelY = string.IsNullOrEmpty(y.OfficialRating) ? 0 : _localization.GetRatingLevel(y.OfficialRating) ?? 0; @@ -32,9 +39,6 @@ namespace Emby.Server.Implementations.Sorting /// Gets the name. /// </summary> /// <value>The name.</value> - public string Name - { - get { return ItemSortBy.OfficialRating; } - } + public string Name => ItemSortBy.OfficialRating; } } |
