From 7efac124c7a3d06f129206da0d18b5ac356a12e8 Mon Sep 17 00:00:00 2001 From: kayone Date: Tue, 26 Nov 2013 22:52:11 -0800 Subject: [PATCH] added input validation around MoveFile --- src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index e9bc7e293..d9cda55e1 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Common; +using NzbDrone.Common.EnsureThat; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Organizer; @@ -59,6 +60,10 @@ public string MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode private void MoveFile(EpisodeFile episodeFile, Series series, string destinationFilename) { + Ensure.That(() => episodeFile).IsNotNull(); + Ensure.That(() => series).IsNotNull(); + Ensure.That(() => destinationFilename).IsValidPath(); + if (!_diskProvider.FileExists(episodeFile.Path)) { throw new FileNotFoundException("Episode file path does not exist", episodeFile.Path);