fix(shared): Guard against exporting without settings
When generating a fully default design that does not require any measurements, the export failed because where we expect a settings object, we get `false` instead. This guards against this scenario by instantiating an empty object in this case. Fixes #5430
This commit is contained in:
parent
fcb15fd229
commit
f8c898827d
1 changed files with 6 additions and 0 deletions
|
@ -114,6 +114,12 @@ export const handleExport = async ({
|
|||
// get a worker going
|
||||
const worker = new Worker(new URL('./export-worker.js', import.meta.url), { type: 'module' })
|
||||
|
||||
/*
|
||||
* Guard against settings being false, which happens for
|
||||
* fully default designs that do not require measurements
|
||||
*/
|
||||
if (settings === false) settings = {}
|
||||
|
||||
// listen for the worker's message back
|
||||
worker.addEventListener('message', (e) => {
|
||||
// on success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue