1
0
Fork 0

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:
joostdecock 2023-11-07 19:24:43 +01:00
parent fcb15fd229
commit f8c898827d

View file

@ -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