diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-02-24 08:35:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-24 08:35:26 -0700 |
| commit | 47b9a01efe098d34dd1d763794ab886d235d724c (patch) | |
| tree | 7fb47e469ac0cebc838d7b8852ce5dd025420c34 /Jellyfin.Api/Controllers/GenresController.cs | |
| parent | f94abc1eb7352404e0250060ed0c57ad369d2457 (diff) | |
| parent | eaeb65f94d94bab40126c12e8fd89c3c5c6b35d8 (diff) | |
Merge pull request #9381 from Bond-009/nullable
Diffstat (limited to 'Jellyfin.Api/Controllers/GenresController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/GenresController.cs | 9 |
1 files changed, 3 insertions, 6 deletions
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); } |
