null check on definition and selected automation

This commit is contained in:
Peter Clement 2024-10-16 15:05:48 +01:00
parent 77a5b3478d
commit bfa3a663f1
1 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ const automationActions = store => ({
*/
traverse: (blockRefs, automation) => {
let blocks = []
if (automation.definition.trigger) {
if (automation.definition?.trigger) {
blocks.push(automation.definition.trigger)
}
blocks = blocks.concat(automation.definition.steps || [])
@ -689,7 +689,7 @@ const automationActions = store => ({
type,
id: generate(),
}
newName = getNewStepName(get(selectedAutomation).data, newStep)
newName = getNewStepName(get(selectedAutomation)?.data, newStep)
newStep.name = newName
return newStep
},