Skip to content

Commit 7575ff0

Browse files
authored
Fixed loading of items under network (#7931)
1 parent a1d8b55 commit 7575ff0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Files.Launcher/Helpers/ShellFolderHelpers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public static ShellFileItem GetShellFileItem(ShellItem folderItem)
4444
folderItem.Properties.TryGetValue<string>(
4545
Ole32.PROPERTYKEY.System.ItemNameDisplay, out var fileName);
4646
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
4849
if (!isFolder && !string.IsNullOrEmpty(parsingPath) && Path.GetExtension(parsingPath) is string realExtension && !string.IsNullOrEmpty(realExtension))
4950
{
5051
if (!string.IsNullOrEmpty(fileName) && !fileName.EndsWith(realExtension, StringComparison.OrdinalIgnoreCase))

0 commit comments

Comments
 (0)