aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/UserLibrary')
-rw-r--r--MediaBrowser.Api/UserLibrary/GenresService.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/MediaBrowser.Api/UserLibrary/GenresService.cs b/MediaBrowser.Api/UserLibrary/GenresService.cs
index 5d362c61a..58dec11f6 100644
--- a/MediaBrowser.Api/UserLibrary/GenresService.cs
+++ b/MediaBrowser.Api/UserLibrary/GenresService.cs
@@ -110,7 +110,19 @@ namespace MediaBrowser.Api.UserLibrary
return items
.SelectMany(i => i.Genres)
.Distinct(StringComparer.OrdinalIgnoreCase)
- .Select(name => LibraryManager.GetGenre(name));
+ .Select(name =>
+ {
+ try
+ {
+ return LibraryManager.GetGenre(name);
+ }
+ catch (Exception ex)
+ {
+ Logger.ErrorException("Error getting genre {0}", ex, name);
+ return null;
+ }
+ })
+ .Where(i => i != null);
}
}
}