Fixed bug when a file that wasn't parsable would try to be imported

This commit is contained in:
kay.one 2011-05-19 19:12:36 -07:00
commit 69406a95d4
2 changed files with 37 additions and 1 deletions

View file

@ -72,11 +72,13 @@ namespace NzbDrone.Core.Providers
if (!_repository.Exists<EpisodeFile>(e => e.Path == Parser.NormalizePath(filePath)))
{
var parseResult = Parser.ParseEpisodeInfo(filePath);
parseResult.CleanTitle = series.Title;//replaces the nasty path as title to help with logging
if (parseResult == null)
return null;
parseResult.CleanTitle = series.Title;//replaces the nasty path as title to help with logging
//Stores the list of episodes to add to the EpisodeFile
var episodes = new List<Episode>();