aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-12-07 08:24:43 -0600
committerGitHub <noreply@github.com>2025-12-07 08:24:43 -0600
commit869c5535218a8fc7bff2c10ae73d59847b19b55f (patch)
treed03b9705320cc46db83a095737ebfdfa2ecbfd76 /src
parent08c959eacb3e16193bfdec745a515c7253b93d2b (diff)
parent88b42219f4bd707713a90656d9177458a447005b (diff)
downloadslskd-869c5535218a8fc7bff2c10ae73d59847b19b55f.tar.gz
Merge pull request #1579 from slskd/copilot/fix-blacklist-validation-error
Add validation to prevent crash when blacklist is enabled without file
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Options.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 254adcab..76dcd45c 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -1252,6 +1252,12 @@ namespace slskd
return results;
}
+ if (string.IsNullOrWhiteSpace(File))
+ {
+ results.Add(new ValidationResult("The Enabled field is true, but no File has been specified."));
+ return results;
+ }
+
// loading/validating the entire list will be costly on low spec systems
// just make sure that we can detect a valid format and leave it at that
// if there's a problem with any of the entries, the load will fail and