Index: runtime/bin/directory_win.cc |
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc |
index 22c7a3a7dc8d991bd43eefc19e0b9bfec8248b14..f5f77bd99dc568fb51a6b9087763e7c0217b8345 100644 |
--- a/runtime/bin/directory_win.cc |
+++ b/runtime/bin/directory_win.cc |
@@ -351,6 +351,7 @@ Directory::ExistsResult Directory::Exists(const char* dir_name) { |
char* Directory::Current() { |
int length = GetCurrentDirectoryW(0, NULL); |
+ if (length == 0) return NULL; |
wchar_t* current = new wchar_t[length + 1]; |
GetCurrentDirectoryW(length + 1, current); |
char* result = StringUtils::WideToUtf8(current); |