From ba3d4690e132a966567db40c8b778c5ed3922833 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 30 May 2026 18:24:27 -0500 Subject: paths ending in a slash don't have a file --- src/slskd/Common/FileSafety.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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) -- cgit v1.2.3