Skip to content

Commit 7335f6f

Browse files
committed
FIX: Crash when trying to open root directory gkngkc#32
1 parent ef2a17e commit 7335f6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ private static string GetDirectoryPath(string directory) {
126126
if (!directoryPath.EndsWith("\\")) {
127127
directoryPath += "\\";
128128
}
129+
if (Path.GetPathRoot(directoryPath) == directoryPath) {
130+
return directory;
131+
}
129132
return Path.GetDirectoryName(directoryPath) + Path.DirectorySeparatorChar;
130133
}
131134
}

0 commit comments

Comments
 (0)