aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/VideosController.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/VideosController.cs
parent6bf34f8e22c6f72bde15cbb4b500fc6c4f3273b3 (diff)
Return NotFound when itemId isn't found
Diffstat (limited to 'Jellyfin.Api/Controllers/VideosController.cs')
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index 01a319879..12aa47ead 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -155,7 +155,12 @@ public class VideosController : BaseJellyfinApiController
if (video.LinkedAlternateVersions.Length == 0)
{
- video = (Video)_libraryManager.GetItemById(video.PrimaryVersionId);
+ video = (Video?)_libraryManager.GetItemById(video.PrimaryVersionId);
+ }
+
+ if (video is null)
+ {
+ return NotFound();
}
foreach (var link in video.GetLinkedAlternateVersions())