diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-02-04 21:08:21 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-02-04 21:08:30 +0100 |
| commit | eb7fee95906f1c9d8d104777e0214de9115ca82f (patch) | |
| tree | e7cc620c3f37175d5102f0ac592e6ec0669db345 /Jellyfin.Api/Controllers/ItemsController.cs | |
| parent | 52230d1c30b76f34132c8c3ad21a09deea72d9d8 (diff) | |
Add more tests
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ItemsController.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs index 1bfc111af..c937176cd 100644 --- a/Jellyfin.Api/Controllers/ItemsController.cs +++ b/Jellyfin.Api/Controllers/ItemsController.cs @@ -6,6 +6,7 @@ using Jellyfin.Api.Extensions; using Jellyfin.Api.Helpers; using Jellyfin.Api.ModelBinders; using Jellyfin.Data.Enums; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; @@ -241,7 +242,7 @@ public class ItemsController : BaseJellyfinApiController var isApiKey = User.GetIsApiKey(); // if api key is used (auth.IsApiKey == true), then `user` will be null throughout this method var user = !isApiKey && userId.HasValue && !userId.Value.Equals(default) - ? _userManager.GetUserById(userId.Value) + ? _userManager.GetUserById(userId.Value) ?? throw new ResourceNotFoundException() : null; // beyond this point, we're either using an api key or we have a valid user |
