diff options
Diffstat (limited to 'MediaBrowser.Api/BaseApiService.cs')
| -rw-r--r-- | MediaBrowser.Api/BaseApiService.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index 09eb1ea41..727ee6fbc 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -125,7 +125,7 @@ namespace MediaBrowser.Api return ResultFactory.GetStaticFileResult(Request, path); } - private readonly char[] _dashReplaceChars = new[] { '?', '/' }; + private readonly char[] _dashReplaceChars = { '?', '/' }; private const char SlugChar = '-'; protected MusicArtist GetArtist(string name, ILibraryManager libraryManager) @@ -168,6 +168,11 @@ namespace MediaBrowser.Api { var user = userManager.GetUserById(userId.Value); + if (user == null) + { + throw new ArgumentException("User not found"); + } + return folder.GetRecursiveChildren(user); } @@ -177,6 +182,11 @@ namespace MediaBrowser.Api { var user = userManager.GetUserById(userId.Value); + if (user == null) + { + throw new ArgumentException("User not found"); + } + return userManager.GetUserById(userId.Value).RootFolder.GetRecursiveChildren(user); } |
