File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Flow.Launcher.Infrastructure/DialogJump Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -832,9 +832,25 @@ private static bool CheckPath(string path, out bool file)
832832 return true ;
833833 }
834834 // file: URI paths
835- var localPath = path . StartsWith ( "file:" , StringComparison . OrdinalIgnoreCase )
836- ? new Uri ( path ) . LocalPath
837- : path ;
835+ string localPath ;
836+ if ( path . StartsWith ( "file:" , StringComparison . OrdinalIgnoreCase ) )
837+ {
838+ // Try to create a URI from the path
839+ if ( Uri . TryCreate ( path , UriKind . Absolute , out var uri ) )
840+ {
841+ localPath = uri . LocalPath ;
842+ }
843+ else
844+ {
845+ // If URI creation fails, treat it as a regular path
846+ // by removing the "file:" prefix
847+ localPath = path . Substring ( 5 ) ;
848+ }
849+ }
850+ else
851+ {
852+ localPath = path ;
853+ }
838854 // Is folder?
839855 var isFolder = Directory . Exists ( localPath ) ;
840856 // Is file?
You can’t perform that action at this time.
0 commit comments