summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/worker_host.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/ops/worker_host.rs b/cli/ops/worker_host.rs
index 9175ca0f1..17e0e397f 100644
--- a/cli/ops/worker_host.rs
+++ b/cli/ops/worker_host.rs
@@ -155,6 +155,13 @@ fn run_worker_thread(
if let Err(e) = result {
let mut sender = worker.internal_channels.sender.clone();
+
+ // If sender is closed it means that worker has already been closed from
+ // within using "globalThis.close()"
+ if sender.is_closed() {
+ return;
+ }
+
sender
.try_send(WorkerEvent::TerminalError(e))
.expect("Failed to post message to host");