Explorar o código

Don't fail people retrieval when one fails to load

Luke Pulverenti %!s(int64=11) %!d(string=hai) anos
pai
achega
20014dea8c
Modificáronse 1 ficheiros con 14 adicións e 2 borrados
  1. 14 2
      MediaBrowser.Api/UserLibrary/PersonsService.cs

+ 14 - 2
MediaBrowser.Api/UserLibrary/PersonsService.cs

@@ -131,8 +131,20 @@ namespace MediaBrowser.Api.UserLibrary
                 .Select(i => i.Name)
                 .Distinct(StringComparer.OrdinalIgnoreCase)
 
-                .Select(name => LibraryManager.GetPerson(name)
-            );
+                .Select(name =>
+                {
+                    try
+                    {
+                        return LibraryManager.GetPerson(name);
+                    }
+                    catch
+                    {
+                        return null;
+                        // Already logged at lower levels
+                    }
+                }
+
+            ).Where(i => i != null);
         }
 
         /// <summary>