mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
added input validation around MoveFile
This commit is contained in:
parent
95324b53d2
commit
7efac124c7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user