mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-27 12:34:56 +01:00
Enable nullable reference types for Emby.Server.Implementations
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <param name="x">The x.</param>
|
||||
/// <param name="y">The y.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
return GetDate(x).CompareTo(GetDate(y));
|
||||
}
|
||||
@@ -26,8 +26,13 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// </summary>
|
||||
/// <param name="x">The x.</param>
|
||||
/// <returns>DateTime.</returns>
|
||||
private static DateTime GetDate(BaseItem x)
|
||||
private static DateTime GetDate(BaseItem? x)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
if (x.PremiereDate.HasValue)
|
||||
{
|
||||
return x.PremiereDate.Value;
|
||||
|
||||
Reference in New Issue
Block a user