From d465d30827937406788cc1c5bcf66a8f9a69c1dc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 22 Sep 2020 15:42:56 +0100 Subject: [PATCH] Fix automation block taglines without bindings --- .../flowchart/AutomationBlockTagline.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte b/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte index 7503f2dc35..1b612390ea 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte @@ -29,10 +29,11 @@ .replace(/}}/, "}}") // Extract schema paths for any input bindings - const inputPaths = formattedTagline - .match(/{{\s*\S+\s*}}/g) - .map(x => x.replace(/[{}]/g, "").trim()) - const schemaPaths = inputPaths.map(x => x.replace(/\./g, ".properties.")) + let inputPaths = formattedTagline.match(/{{\s*\S+\s*}}/g) || [] + inputPaths = inputPaths.map(path => path.replace(/[{}]/g, "").trim()) + const schemaPaths = inputPaths.map(path => + path.replace(/\./g, ".properties.") + ) // Replace any enum bindings with their pretty equivalents schemaPaths.forEach((path, idx) => {