From c2328e4b79071bfc22b0ec4d6b43eb4df27dc5c2 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 11 Apr 2022 08:30:39 -0500 Subject: [PATCH] Fixed: Don't die if Plex watchlist guid node is missing or null Fixes #7213 --- src/NzbDrone.Core.Test/Files/plex_watchlist.json | 5 +++++ src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/Files/plex_watchlist.json b/src/NzbDrone.Core.Test/Files/plex_watchlist.json index 21452de97..7c4929c66 100644 --- a/src/NzbDrone.Core.Test/Files/plex_watchlist.json +++ b/src/NzbDrone.Core.Test/Files/plex_watchlist.json @@ -35,6 +35,11 @@ "title": "Avengers: Endgame", "year": 2019, "Guid": [] + }, + { + "type": "movie", + "title": "Avengers", + "year": 2005 } ] } diff --git a/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs b/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs index 1778f9602..36fbc670d 100644 --- a/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs +++ b/src/NzbDrone.Core/ImportLists/Plex/PlexParser.cs @@ -73,7 +73,7 @@ namespace NzbDrone.Core.ImportLists.Plex { var scheme = $"{prefix}://"; - return guids.FirstOrDefault((guid) => guid.Id.StartsWith(scheme))?.Id.Replace(scheme, ""); + return guids?.FirstOrDefault((guid) => guid.Id.StartsWith(scheme))?.Id.Replace(scheme, ""); } } }