diff --git a/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs b/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs index 9035a541d29..3941bc114fc 100644 --- a/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs +++ b/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs @@ -828,9 +828,25 @@ private static bool CheckPath(string path, out bool file) return true; } // file: URI paths - var localPath = path.StartsWith("file:", StringComparison.OrdinalIgnoreCase) - ? new Uri(path).LocalPath - : path; + string localPath; + if (path.StartsWith("file:", StringComparison.OrdinalIgnoreCase)) + { + // Try to create a URI from the path + if (Uri.TryCreate(path, UriKind.Absolute, out var uri)) + { + localPath = uri.LocalPath; + } + else + { + // If URI creation fails, treat it as a regular path + // by removing the "file:" prefix + localPath = path.Substring(5); + } + } + else + { + localPath = path; + } // Is folder? var isFolder = Directory.Exists(localPath); // Is file?