Null safety when creating automation from design

This commit is contained in:
Mel O'Hagan 2022-09-12 08:57:44 +01:00
parent ecb0bad923
commit 8e8ee2b056
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,7 @@
)
newBlock.inputs = {
fields: Object.keys(parameters.fields).reduce((fields, key) => {
fields: Object.keys(parameters.fields ?? {}).reduce((fields, key) => {
fields[key] = "string"
return fields
}, {}),
@ -66,6 +66,7 @@
$automationStore.selectedAutomation.automation._id
delete parameters.newAutomationName
} catch (error) {
console.log("ERROR ", error)
notifications.error("Error creating automation")
}
}