From 7f18c06b0a17eb08fdf5fa2228998daaa4ffcd4b Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:11:14 +0800 Subject: [PATCH] fix: code-block-missing-checks (#7002) --- .../nodes/_base/components/variable/utils.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts index d507af5d8d..e48e6704ad 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -125,12 +125,14 @@ const formatItem = ( const { outputs, } = data as CodeNodeType - res.vars = Object.keys(outputs).map((key) => { - return { - variable: key, - type: outputs[key].type, - } - }) + res.vars = outputs + ? Object.keys(outputs).map((key) => { + return { + variable: key, + type: outputs[key].type, + } + }) + : [] break }