Index: runtime/bin/directory.cc |
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc |
index 0f771eecbdf38cde1ef019fd9b56c05e459db771..c7b499a4906c929faa64117611c0a2962fdedc96 100644 |
--- a/runtime/bin/directory.cc |
+++ b/runtime/bin/directory.cc |
@@ -26,6 +26,10 @@ void FUNCTION_NAME(Directory_Current)(Dart_NativeArguments args) { |
if (current != NULL) { |
Dart_SetReturnValue(args, DartUtils::NewString(current)); |
free(current); |
+ } else { |
+ Dart_Handle err = DartUtils::NewDartOSError(); |
+ if (Dart_IsError(err)) Dart_PropagateError(err); |
+ Dart_SetReturnValue(args, err); |
} |
} |