mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix DialogJump UriFormatException when navigating to root directories (#4052)
This commit is contained in:
parent
3d9ef2c63f
commit
3690042d2c
1 changed files with 19 additions and 3 deletions
|
|
@ -828,9 +828,25 @@ namespace Flow.Launcher.Infrastructure.DialogJump
|
|||
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?
|
||||
|
|
|
|||
Loading…
Reference in a new issue