From f7fb91ee6e7059c704d37dc6f0ce113eb451fd30 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 5 Aug 2022 20:52:17 +0800 Subject: [PATCH] fixup! fixup! bootstrap: check more metadata when loading the snapshot --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index e3ebd36b0a6902..3eb3524d182d14 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1240,7 +1240,7 @@ int LoadSnapshotDataAndRun(const SnapshotData** snapshot_data_ptr, // snapshot, but we will skip it if --no-node-snapshot is specified. const node::SnapshotData* read_data = SnapshotBuilder::GetEmbeddedSnapshotData(); - if (read_data->Check()) { + if (read_data != nullptr && read_data->Check()) { // If we fail to read the embedded snapshot, treat it as if Node.js // was built without one. *snapshot_data_ptr = read_data;