Skip to content

Commit

Permalink
fix: Only send postMessage through worker if it's defined (#4722)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester authored May 30, 2022
1 parent 29ef318 commit 2afa4bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ace/worker/worker_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var WorkerClient = function(worker) {
// TODO: cleanup event
if (data.data && data.data.err)
data.data.err = {message: data.data.err.message, stack: data.data.err.stack, code: data.data.err.code};
this.$worker.postMessage({event: event, data: {data: data.data}});
this.$worker && this.$worker.postMessage({event: event, data: {data: data.data}});
}
catch(ex) {
console.error(ex.stack);
Expand Down

0 comments on commit 2afa4bf

Please sign in to comment.