From 3737fb14e3371b2004c7fdb52178e42946a84963 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 25 Nov 2024 20:34:04 +0000 Subject: [PATCH] pr comment --- .../builder/src/stores/builder/automations.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/stores/builder/automations.js b/packages/builder/src/stores/builder/automations.js index 9c27233c06..b7d55ee2d4 100644 --- a/packages/builder/src/stores/builder/automations.js +++ b/packages/builder/src/stores/builder/automations.js @@ -527,10 +527,21 @@ const automationActions = store => ({ } else if ( currentBlock?.stepId === AutomationActionStepId.EXECUTE_SCRIPT ) { - runtimeName = `steps["${pathSteps[idx]?.id}"].${name}` + const stepId = pathSteps[idx].id + if (!stepId) { + notifications.error("Error generating binding: Step ID not found.") + return null + } + runtimeName = `steps["${stepId}"].${name}` } else { - runtimeName = `steps.${pathSteps[idx]?.id}.${name}` + const stepId = pathSteps[idx].id + if (!stepId) { + notifications.error("Error generating binding: Step ID not found.") + return null + } + runtimeName = `steps.${stepId}.${name}` } + return runtimeName }