aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-05-30 18:24:27 -0500
committerJP Dillingham <jp@dillingham.me>2026-05-30 18:24:27 -0500
commitba3d4690e132a966567db40c8b778c5ed3922833 (patch)
treefbf4633f177bf0f15e64ab8f9bd145a040b4b11f /src
parent64db0b76b4a7f3242887d81b18414b8983a0d888 (diff)
downloadslskd-ba3d4690e132a966567db40c8b778c5ed3922833.tar.gz
paths ending in a slash don't have a file
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/FileSafety.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Common/FileSafety.cs b/src/slskd/Common/FileSafety.cs
index 7e8c3516..6c1ce8b6 100644
--- a/src/slskd/Common/FileSafety.cs
+++ b/src/slskd/Common/FileSafety.cs
@@ -229,6 +229,11 @@ public static class FileSafety
{
ArgumentNullException.ThrowIfNull(path);
+ if (path.EndsWith('/') || path.EndsWith('\\'))
+ {
+ return null;
+ }
+
return LocalizePath(path, os)
.Split(Path.DirectorySeparatorChar)
.TakeLast(1)