From 68cd9ab8c87b266b8f727695fdc2cf952a4f12af Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 4 Oct 2015 12:12:07 -0700 Subject: [PATCH] Don't error out if PMS returns no ID for a specific series Closes #813 --- src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs index ad9abb3a0..7ff45357a 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs @@ -107,16 +107,15 @@ namespace NzbDrone.Core.Notifications.Plex _logger.Trace("Sections response: {0}", response.Content); CheckForError(response, settings); - var item = Json.Deserialize(response.Content) - .Items - .FirstOrDefault(); + var items = Json.Deserialize(response.Content) + .Items; - if (item == null) + if (items == null || items.Empty()) { return null; } - return item.Id; + return items.First().Id; } private string Authenticate(PlexServerSettings settings)