Ensure path is valid before watching it

(cherry picked from commit 1245b2c58b5a1b5fb4aee9a4f974ecfb131de2bd)
pull/2767/head
Bogdan 1 year ago
parent 156407c541
commit 5e9e578101

@ -6,6 +6,7 @@ using System.Linq;
using System.Threading.Tasks;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.TPL;
using NzbDrone.Core.Configuration;
@ -116,6 +117,9 @@ namespace NzbDrone.Core.MediaFiles
private void StartWatchingPath(string path)
{
Ensure.That(path, () => path).IsNotNullOrWhiteSpace();
Ensure.That(path, () => path).IsValidPath(PathValidationType.CurrentOs);
// Already being watched
if (_fileSystemWatchers.ContainsKey(path))
{

Loading…
Cancel
Save