Skip to content

Commit ae7fc0b

Browse files
Fix: Properly handle drive root paths without a path
1 parent 80c9b43 commit ae7fc0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Files.App/Data/Items/DriveItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ public static async Task<DriveItem> CreateFromPropertiesAsync(StorageFolder root
252252
ShowShellItems = true,
253253
ShowProperties = true
254254
};
255-
item.Path = string.IsNullOrEmpty(root.Path) ? $"\\\\?\\{root.Name}\\" : root.Path;
255+
item.Path = string.IsNullOrEmpty(root.Path) && !root.Name.EndsWith('\\') ? deviceId :
256+
(string.IsNullOrEmpty(root.Path) ? $"\\\\?\\{root.Name}\\" : root.Path);
256257
item.DeviceID = deviceId;
257258
item.Root = root;
258259

0 commit comments

Comments
 (0)