mirror of
https://github.com/Readarr/Readarr
synced 2026-02-10 08:42:14 +01:00
Ensure path is valid before watching it
(cherry picked from commit 1245b2c58b5a1b5fb4aee9a4f974ecfb131de2bd)
This commit is contained in:
parent
156407c541
commit
5e9e578101
1 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
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 @@ public void Handle(ModelEvent<RootFolder> message)
|
|||
|
||||
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…
Reference in a new issue