From 1245b2c58b5a1b5fb4aee9a4f974ecfb131de2bd Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 4 Aug 2023 15:12:40 +0300 Subject: [PATCH] Ensure path is valid before watching it --- src/NzbDrone.Core/MediaFiles/RootFolderWatchingService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/NzbDrone.Core/MediaFiles/RootFolderWatchingService.cs b/src/NzbDrone.Core/MediaFiles/RootFolderWatchingService.cs index 9ce640b82..afa8fc771 100644 --- a/src/NzbDrone.Core/MediaFiles/RootFolderWatchingService.cs +++ b/src/NzbDrone.Core/MediaFiles/RootFolderWatchingService.cs @@ -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)) {