diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 5e3d793bc6..c628725e49 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -90,6 +90,20 @@ public void PathParse_tests(string path, int season, int episode) 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.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)] [TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)] diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 2442d553f7..f4c9b8eced 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -77,7 +77,10 @@ internal static EpisodeParseResult ParsePath(string path) result = ParseTitle(fileInfo.FullName); } - result.OriginalString = path; + if (result != null) + { + result.OriginalString = path; + } return result; }