diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-06-11 16:41:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-11 16:41:27 -0400 |
| commit | 24975638f9772fbec4005f97ff954e01ce22a41f (patch) | |
| tree | 3b99c916799efa86005601b63076ae33f530c98a /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | 4fa170ab080b59ff3e5d8f913a42dfd7d21dbaa3 (diff) | |
| parent | 27d9ace40442aa50c0d27c318a8719a00796e950 (diff) | |
Merge pull request #2700 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 4112eb444..d9fc7143f 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -27,6 +27,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.IO; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Services; +using MediaBrowser.Common.Extensions; namespace MediaBrowser.Api.Library { @@ -830,6 +831,11 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); + if (item == null) + { + throw new ResourceNotFoundException("Item not found."); + } + while (item.ThemeSongIds.Count == 0 && request.InheritFromParent && item.GetParent() != null) { item = item.GetParent(); @@ -874,6 +880,11 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); + if (item == null) + { + throw new ResourceNotFoundException("Item not found."); + } + while (item.ThemeVideoIds.Count == 0 && request.InheritFromParent && item.GetParent() != null) { item = item.GetParent(); |
