Fixed an issue where an unparsable item could break the parser.

pull/4/head
kay.one 13 years ago
parent 0276fa12f0
commit b6d43273cf

@ -90,6 +90,20 @@ namespace NzbDrone.Core.Test
ExceptionVerification.IgnoreWarns(); ExceptionVerification.IgnoreWarns();
} }
[Test]
public void unparsable_path()
{
Parser.ParsePath("C:\\").Should().BeNull();
ExceptionVerification.IgnoreWarns();
}
[Test]
public void unparsable_title()
{
Parser.ParseTitle("SOMETHING").Should().BeNull();
ExceptionVerification.IgnoreWarns();
}
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)] [TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)]
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)] [TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)]
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)] [TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)]

@ -77,7 +77,10 @@ namespace NzbDrone.Core
result = ParseTitle(fileInfo.FullName); result = ParseTitle(fileInfo.FullName);
} }
result.OriginalString = path; if (result != null)
{
result.OriginalString = path;
}
return result; return result;
} }

Loading…
Cancel
Save