aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-05-23 12:43:58 -0500
committerGitHub <noreply@github.com>2021-05-23 12:43:58 -0500
commitc72d7088ce6d39193ae1a80f2808e34d07e6078f (patch)
tree9399a62ea4b2de56d065c67d96e813d115467092 /src
parente026ad46d81654c421d71821d0033ab3ce2332fa (diff)
parent6a46c1af77b3a9b04e55e71590c7841f987c170e (diff)
downloadslskd-c72d7088ce6d39193ae1a80f2808e34d07e6078f.tar.gz
Merge pull request #80 from slskd/directory-fix
Don't invalidate missing directories if they are within the default path
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/Validation/DirectoryExistsAttributes.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/slskd/Common/Validation/DirectoryExistsAttributes.cs b/src/slskd/Common/Validation/DirectoryExistsAttributes.cs
index 34ea2f19..45d7f71b 100644
--- a/src/slskd/Common/Validation/DirectoryExistsAttributes.cs
+++ b/src/slskd/Common/Validation/DirectoryExistsAttributes.cs
@@ -31,7 +31,7 @@ namespace slskd.Validation
{
var dir = Path.GetFullPath(value?.ToString());
- if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
+ if (!dir.StartsWith(Program.DefaultAppDirectory) && !string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
{
return new ValidationResult($"The {validationContext.DisplayName} field specifies a non-existent directory '{dir}'.");
}