From 465b24e6b0a7a2081836c079c1f6637af8b6edbf Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 18 Sep 2016 17:21:24 +0100 Subject: [PATCH] added some error handing around the GetMovie area #517 --- PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs b/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs index c8b46b32f..701a5fb50 100644 --- a/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs +++ b/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs @@ -195,9 +195,18 @@ namespace PlexRequests.Services.Jobs public PlexMovie GetMovie(PlexMovie[] plexMovies, string title, string year, string providerId = null) { + if (plexMovies.Length == 0) + { + return null; + } var advanced = !string.IsNullOrEmpty(providerId); foreach (var movie in plexMovies) { + if (string.IsNullOrEmpty(movie.Title) || string.IsNullOrEmpty(movie.ReleaseYear)) + { + continue; + } + if (advanced) { if (!string.IsNullOrEmpty(movie.ProviderId) &&