Ensure path is valid before watching it

pull/3968/head
Bogdan 1 year ago
parent 108fc8c724
commit 1245b2c58b

@ -116,6 +116,9 @@ namespace NzbDrone.Core.MediaFiles
private void StartWatchingPath(string path) private void StartWatchingPath(string path)
{ {
Ensure.That(path, () => path).IsNotNullOrWhiteSpace();
Ensure.That(path, () => path).IsValidPath(PathValidationType.CurrentOs);
// Already being watched // Already being watched
if (_fileSystemWatchers.ContainsKey(path)) if (_fileSystemWatchers.ContainsKey(path))
{ {

Loading…
Cancel
Save