Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index b92d5572779f28e8e5e4ab677316621b60e91c8a..300fe57e1a3d6a998f8627adbce2bbb0dcef93dc 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -5416,6 +5416,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()); |