Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 866a0bc22441e84f5339397ba42f9ce2c190ea44..483f07a9f241d1df59627af1c1d52c1d4cf19dc8 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -511,8 +511,11 @@ SnapshotCreator::SnapshotCreator(intptr_t* external_references, |
internal_isolate->set_array_buffer_allocator(&data->allocator_); |
internal_isolate->set_api_external_references(external_references); |
isolate->Enter(); |
- if (existing_snapshot) { |
- internal_isolate->set_snapshot_blob(existing_snapshot); |
+ const StartupData* blob = existing_snapshot |
+ ? existing_snapshot |
+ : i::Snapshot::DefaultSnapshotBlob(); |
+ if (blob && blob->raw_size > 0) { |
+ internal_isolate->set_snapshot_blob(blob); |
i::Snapshot::Initialize(internal_isolate); |
} else { |
internal_isolate->Init(nullptr); |