aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ItemsController.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2023-02-04 17:56:12 +0100
committerBond_009 <bond.009@outlook.com>2023-02-04 20:11:08 +0100
commit52230d1c30b76f34132c8c3ad21a09deea72d9d8 (patch)
treed42c6cbb0ba99e2d6b4414b4aee4d454c5699d9f /Jellyfin.Api/Controllers/ItemsController.cs
parent6bf34f8e22c6f72bde15cbb4b500fc6c4f3273b3 (diff)
Return NotFound when itemId isn't found
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ItemsController.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 134974dbe..1bfc111af 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -815,6 +815,11 @@ public class ItemsController : BaseJellyfinApiController
[FromQuery] bool excludeActiveSessions = false)
{
var user = _userManager.GetUserById(userId);
+ if (user is null)
+ {
+ return NotFound();
+ }
+
var parentIdGuid = parentId ?? Guid.Empty;
var dtoOptions = new DtoOptions { Fields = fields }
.AddClientFields(User)