diff options
| author | Niels van Velzen <git@ndat.nl> | 2021-06-12 16:19:34 +0200 |
|---|---|---|
| committer | Niels van Velzen <git@ndat.nl> | 2021-06-12 16:19:34 +0200 |
| commit | 226abde3f72ccfc768766ce2ff295cb0972b6426 (patch) | |
| tree | 49b725100cdc87db062c0b2717a8765ceffd97b3 /Jellyfin.Api/Controllers/ItemsController.cs | |
| parent | 93dbbfea03612e5b0321c31b80207a00a1691619 (diff) | |
Change userId to required in operations that would otherwise throw exceptions
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ItemsController.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs index 74cf3b162..35c27dd0e 100644 --- a/Jellyfin.Api/Controllers/ItemsController.cs +++ b/Jellyfin.Api/Controllers/ItemsController.cs @@ -143,7 +143,7 @@ namespace Jellyfin.Api.Controllers [HttpGet("Items")] [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult<QueryResult<BaseItemDto>> GetItems( - [FromQuery] Guid? userId, + [FromQuery] Guid userId, [FromQuery] string? maxOfficialRating, [FromQuery] bool? hasThemeSong, [FromQuery] bool? hasThemeVideo, @@ -224,8 +224,8 @@ namespace Jellyfin.Api.Controllers [FromQuery] bool enableTotalRecordCount = true, [FromQuery] bool? enableImages = true) { - var user = userId.HasValue && !userId.Equals(Guid.Empty) - ? _userManager.GetUserById(userId.Value) + var user = !userId.Equals(Guid.Empty) + ? _userManager.GetUserById(userId) : null; var dtoOptions = new DtoOptions { Fields = fields } .AddClientFields(Request) |
