Index: runtime/bin/dartutils.cc |
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc |
index 3379b168ffde450f56e81d021b2dc8ee873ba2ac..a803fca4e4deee78074326eb7962123d808c39d1 100644 |
--- a/runtime/bin/dartutils.cc |
+++ b/runtime/bin/dartutils.cc |
@@ -566,9 +566,13 @@ Dart_Handle DartUtils::NewDartExceptionWithMessage(const char* library_url, |
const char* message) { |
// Create a Dart Exception object with a message. |
Dart_Handle clazz = GetDartClass(library_url, exception_name); |
- Dart_Handle args[1]; |
- args[0] = NewString(message); |
- return Dart_New(clazz, Dart_Null(), 1, args); |
+ if (message != NULL) { |
+ Dart_Handle args[1]; |
+ args[0] = NewString(message); |
+ return Dart_New(clazz, Dart_Null(), 1, args); |
+ } else { |
+ return Dart_New(clazz, Dart_Null(), 0, NULL); |
+ } |
} |