diff --git a/src/node_platform.cc b/src/node_platform.cc index 6085c9487b6bf9..960583390318ca 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -406,7 +406,7 @@ int NodePlatform::NumberOfWorkerThreads() { } void PerIsolatePlatformData::RunForegroundTask(std::unique_ptr task) { - if (isolate_->IsExecutionTerminating()) return task->Run(); + if (isolate_->IsExecutionTerminating()) return; DebugSealHandleScope scope(isolate_); Environment* env = Environment::GetCurrent(isolate_); if (env != nullptr) {