mirror of https://github.com/Sonarr/Sonarr
Guard against a null file showing an exception in release rejections
Fixes #1755
This commit is contained in:
parent
ec7f749541
commit
bf5067466d
|
@ -1,4 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||||
using NzbDrone.Core.Parser.Model;
|
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))
|
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))
|
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.Profile, file.Quality, subject.ParsedEpisodeInfo.Quality))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||||
using NzbDrone.Core.Parser.Model;
|
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))
|
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);
|
_logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality);
|
||||||
|
|
||||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, file.Quality, subject.ParsedEpisodeInfo.Quality))
|
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.Profile, file.Quality, subject.ParsedEpisodeInfo.Quality))
|
||||||
|
|
Loading…
Reference in New Issue