diff options
| author | Bond-009 <bond.009@outlook.com> | 2023-02-12 16:32:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-12 16:32:00 +0100 |
| commit | 5e074ac945a184fc583703cb9a1d705c0463ef4e (patch) | |
| tree | f4ede552ec534482fc8caefd6472481e122a89b0 /Jellyfin.Api/Controllers/LibraryController.cs | |
| parent | f5c970e67ff922808cb5684d1185966e19fd789b (diff) | |
| parent | eb7fee95906f1c9d8d104777e0214de9115ca82f (diff) | |
Merge pull request #9253 from Bond-009/nullref
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/LibraryController.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs index 830f84849..c4309412c 100644 --- a/Jellyfin.Api/Controllers/LibraryController.cs +++ b/Jellyfin.Api/Controllers/LibraryController.cs @@ -283,6 +283,11 @@ public class LibraryController : BaseJellyfinApiController userId, inheritFromParent); + if (themeSongs.Result is NotFoundObjectResult || themeVideos.Result is NotFoundObjectResult) + { + return NotFound(); + } + return new AllThemeMediaResult { ThemeSongsResult = themeSongs?.Value, @@ -452,6 +457,10 @@ public class LibraryController : BaseJellyfinApiController if (user is not null) { parent = TranslateParentItem(parent, user); + if (parent is null) + { + break; + } } baseItemDtos.Add(_dtoService.GetBaseItemDto(parent, dtoOptions, user)); @@ -672,6 +681,11 @@ public class LibraryController : BaseJellyfinApiController : _libraryManager.GetUserRootFolder()) : _libraryManager.GetItemById(itemId); + if (item is null) + { + return NotFound(); + } + if (item is Episode || (item is IItemByName && item is not MusicArtist)) { return new QueryResult<BaseItemDto>(); |
