Delay Profile: Fix for when preferred words is null. (#618)

pull/628/head
vertigo235 8 years ago committed by Leonardo Galli
parent 520836f475
commit d67d405024

@ -44,8 +44,17 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
// Preferred word count // Preferred word count
var title = subject.Release.Title; var title = subject.Release.Title;
var preferredWords = subject.Movie.Profile.Value.PreferredTags; var preferredWords = subject.Movie.Profile.Value.PreferredTags;
var preferredCount = preferredWords.AsEnumerable().Count(w => title.ToLower().Contains(w.ToLower())); var preferredCount = 0;
if (preferredWords == null)
{
preferredCount = 1;
_logger.Debug("Preferred words is null, setting preffered count to 1.");
}
else
{
preferredCount = preferredWords.AsEnumerable().Count(w => title.ToLower().Contains(w.ToLower()));
}
if (delay == 0) if (delay == 0)
{ {

Loading…
Cancel
Save