Skip to content

Commit ff3b7d2

Browse files
codebyteretargos
authored andcommitted
src: ensure V8 initialized before marking milestone
PR-URL: #40405 Refs: electron/electron#31349 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 618bbbf commit ff3b7d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/env.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,11 @@ void Environment::InitializeMainContext(Local<Context> context,
458458
environment_start_time_);
459459
performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_NODE_START,
460460
per_process::node_start_time);
461-
performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START,
462-
performance::performance_v8_start);
461+
462+
if (per_process::v8_initialized) {
463+
performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START,
464+
performance::performance_v8_start);
465+
}
463466
}
464467

465468
Environment::~Environment() {

0 commit comments

Comments
 (0)