File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Files.Launcher/Helpers Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ public static ShellFileItem GetShellFileItem(ShellItem folderItem)
44
44
folderItem . Properties . TryGetValue < string > (
45
45
Ole32 . PROPERTYKEY . System . ItemNameDisplay , out var fileName ) ;
46
46
fileName ??= Path . GetFileName ( folderItem . Name ) ; // Original file name
47
- string filePath = Path . Combine ( Path . GetDirectoryName ( parsingPath ) , folderItem . Name ) ; // In recycle bin "Name" contains original file path + name
47
+ string filePath = string . IsNullOrEmpty ( Path . GetDirectoryName ( parsingPath ) ) ? // Null if root
48
+ parsingPath : Path . Combine ( Path . GetDirectoryName ( parsingPath ) , folderItem . Name ) ; // In recycle bin "Name" contains original file path + name
48
49
if ( ! isFolder && ! string . IsNullOrEmpty ( parsingPath ) && Path . GetExtension ( parsingPath ) is string realExtension && ! string . IsNullOrEmpty ( realExtension ) )
49
50
{
50
51
if ( ! string . IsNullOrEmpty ( fileName ) && ! fileName . EndsWith ( realExtension , StringComparison . OrdinalIgnoreCase ) )
You can’t perform that action at this time.
0 commit comments