Index: sky/engine/core/script/dart_controller.cc |
diff --git a/sky/engine/core/script/dart_controller.cc b/sky/engine/core/script/dart_controller.cc |
index 73d410f6dd14846a584fac37b39bf5ce02e94fcb..a46fcc256a4803d8cfb571070d373c630f121df7 100644 |
--- a/sky/engine/core/script/dart_controller.cc |
+++ b/sky/engine/core/script/dart_controller.cc |
@@ -100,7 +100,9 @@ void DartController::ExecuteModule(RefPtr<AbstractModule> module) { |
DCHECK(Dart_CurrentIsolate() == dart_state()->isolate()); |
DartApiScope dart_api_scope; |
- LogIfError(Dart_FinalizeLoading(true)); |
+ // Don't continue if we failed to load the module. |
+ if (LogIfError(Dart_FinalizeLoading(true))) |
+ return; |
Dart_Handle library = module->library()->dart_value(); |
const char* name = module->isApplication() ? "main" : "init"; |
Dart_Handle closure_name = Dart_NewStringFromCString(name); |