Guard against a null file showing an exception in release rejections

Fixes #1755
This commit is contained in:
Mark McDowall 2017-03-26 13:01:59 -07:00
parent ec7f749541
commit bf5067466d
2 changed files with 14 additions and 3 deletions

View File

@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using NLog;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
@ -22,8 +22,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
foreach (var file in subject.Episodes.Where(c => c.EpisodeFileId != 0).Select(c => c.EpisodeFile.Value))
{
_logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality);
if (file == null)
{
_logger.Debug("File is no longer avaialble, skipping this file.");
continue;
}
_logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality);
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.Profile, file.Quality, subject.ParsedEpisodeInfo.Quality))
{

View File

@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using NLog;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
@ -22,6 +22,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
foreach (var file in subject.Episodes.Where(c => c.EpisodeFileId != 0).Select(c => c.EpisodeFile.Value))
{
if(file == null)
{
_logger.Debug("File is no longer avaialble, skipping this file.");
continue;
}
_logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality);
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, file.Quality, subject.ParsedEpisodeInfo.Quality))