From b1e772d8521f9dd84f8013774796fcb5c1bb34c3 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 11 Apr 2013 09:13:57 -0700 Subject: [PATCH] Fixed some broken tests --- .../MediaFileTests/MediaFileServiceTest.cs | 2 +- NzbDrone.Core/Tv/Series.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs b/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs index a1ff8d200..1517a3151 100644 --- a/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs +++ b/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs @@ -33,7 +33,7 @@ public void CalculateFilePath_SeasonFolder_SingleNumber(string filename, int sea { var fakeSeries = Builder.CreateNew() .With(s => s.Title = "30 Rock") - .With(s => s.RootFolder = new LazyLoaded(new RootFolder { Path = @"C:\Test\TV" })) + .With(s => s.RootFolder = new LazyLoaded(new RootFolder { Path = @"C:\Test" })) .With(s => s.FolderName = "30 Rock") .With(s => s.SeasonFolder = useSeasonFolder) .Build(); diff --git a/NzbDrone.Core/Tv/Series.cs b/NzbDrone.Core/Tv/Series.cs index 01e30bf0e..8b38e2b6e 100644 --- a/NzbDrone.Core/Tv/Series.cs +++ b/NzbDrone.Core/Tv/Series.cs @@ -53,7 +53,15 @@ public Series() //Todo: Use this to auto link RootFolder and Folder (using the proper path separator) public string Path { - get { return System.IO.Path.Combine(RootFolder.Value.Path, FolderName); } + get + { + if (RootFolder == null || RootFolder.Value == null || String.IsNullOrWhiteSpace(RootFolder.Value.Path)) + { + return null; + } + + return System.IO.Path.Combine(RootFolder.Value.Path, FolderName); + } } //Todo: This should be a double since there are timezones that aren't on a full hour offset