diff --git a/src/node_platform.cc b/src/node_platform.cc index b87413bcb9cfcb..1d761c345f95e9 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) {