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 @@ -828,9 +828,25 @@ private static bool CheckPath(string path, out bool file)
828828 return true ;
829829 }
830830 // file: URI paths
831- var localPath = path . StartsWith ( "file:" , StringComparison . OrdinalIgnoreCase )
832- ? new Uri ( path ) . LocalPath
833- : path ;
831+ string localPath ;
832+ if ( path . StartsWith ( "file:" , StringComparison . OrdinalIgnoreCase ) )
833+ {
834+ // Try to create a URI from the path
835+ if ( Uri . TryCreate ( path , UriKind . Absolute , out var uri ) )
836+ {
837+ localPath = uri . LocalPath ;
838+ }
839+ else
840+ {
841+ // If URI creation fails, treat it as a regular path
842+ // by removing the "file:" prefix
843+ localPath = path . Substring ( 5 ) ;
844+ }
845+ }
846+ else
847+ {
848+ localPath = path ;
849+ }
834850 // Is folder?
835851 var isFolder = Directory . Exists ( localPath ) ;
836852 // Is file?
You can’t perform that action at this time.
0 commit comments