Skip to content

Commit

Permalink
make sure error is defined (fix #439)
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Aug 7, 2023
1 parent 4ab1265 commit 1b72460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/z-worker-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function sendMessage(message) {
}
}

function sendErrorMessage(error) {
function sendErrorMessage(error = new Error("Unknown error")) {
const { message, stack, code, name } = error;
postMessage({ error: { message, stack, code, name } });
}

0 comments on commit 1b72460

Please sign in to comment.