Ensure path is valid before watching it

This commit is contained in:
Bogdan 2023-08-04 15:12:40 +03:00
parent 108fc8c724
commit 1245b2c58b
1 changed files with 3 additions and 0 deletions

View File

@ -116,6 +116,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))
{