From 177e4b850eabec09a94fa05c41e1bc239bb612ee Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 2 Aug 2013 20:28:17 -0700 Subject: [PATCH] Fixed the broken tests --- NzbDrone.Core/RootFolders/RootFolderService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core/RootFolders/RootFolderService.cs b/NzbDrone.Core/RootFolders/RootFolderService.cs index 505a17997..16939e375 100644 --- a/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -65,6 +65,8 @@ namespace NzbDrone.Core.RootFolders public virtual RootFolder Add(RootFolder rootFolder) { + var all = All(); + if (String.IsNullOrWhiteSpace(rootFolder.Path) || !Path.IsPathRooted(rootFolder.Path)) throw new ArgumentException("Invalid path"); @@ -74,7 +76,8 @@ namespace NzbDrone.Core.RootFolders if (All().Exists(r => DiskProvider.PathEquals(r.Path, rootFolder.Path))) throw new InvalidOperationException("Recent directory already exist."); - if (DiskProvider.PathEquals(_configService.DownloadedEpisodesFolder, rootFolder.Path)) + if (!String.IsNullOrWhiteSpace(_configService.DownloadedEpisodesFolder) && + DiskProvider.PathEquals(_configService.DownloadedEpisodesFolder, rootFolder.Path)) throw new InvalidOperationException("Drone Factory folder cannot be used."); _rootFolderRepository.Insert(rootFolder);