From ab24c0e2cf0e678146474db10ecb8e5f86764a10 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 23 Feb 2023 19:09:16 +0100 Subject: Enable nullable for more files --- Jellyfin.Api/Controllers/GenresController.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Jellyfin.Api/Controllers/GenresController.cs') diff --git a/Jellyfin.Api/Controllers/GenresController.cs b/Jellyfin.Api/Controllers/GenresController.cs index eb03b514c..da60f2c60 100644 --- a/Jellyfin.Api/Controllers/GenresController.cs +++ b/Jellyfin.Api/Controllers/GenresController.cs @@ -172,12 +172,9 @@ public class GenresController : BaseJellyfinApiController item ??= new Genre(); - if (userId.Value.Equals(default)) - { - return _dtoService.GetBaseItemDto(item, dtoOptions); - } - - var user = _userManager.GetUserById(userId.Value); + var user = userId.Value.Equals(default) + ? null + : _userManager.GetUserById(userId.Value); return _dtoService.GetBaseItemDto(item, dtoOptions, user); } -- cgit v1.2.3