Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 979f1b88f146478df4c0a95c901c6df12bcb12e6..cfa0c6ea1212561e76066986142e6f0da9c438d7 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -5407,6 +5407,10 @@ DART_EXPORT Dart_Handle Dart_LoadKernel(void* kernel_program) { |
if (tmp.IsError()) { |
return Api::NewHandle(T, tmp.raw()); |
} |
+ if (tmp.IsNull()) { |
+ return Api::NewError("%s: The binary program does not contain 'main'.", |
+ CURRENT_FUNC); |
+ } |
library ^= tmp.raw(); |
I->object_store()->set_root_library(library); |
return Api::NewHandle(T, library.raw()); |