From bfa3a663f1f3f200ea043c20514cc411afd61b60 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 16 Oct 2024 15:05:48 +0100 Subject: [PATCH] null check on definition and selected automation --- packages/builder/src/stores/builder/automations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/stores/builder/automations.js b/packages/builder/src/stores/builder/automations.js index 78328f9a38..d18125a74c 100644 --- a/packages/builder/src/stores/builder/automations.js +++ b/packages/builder/src/stores/builder/automations.js @@ -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 },