From b96459b656e94796edb22537e750dc626803ce19 Mon Sep 17 00:00:00 2001 From: zhsama Date: Wed, 4 Feb 2026 15:19:07 +0800 Subject: [PATCH] fix: Fix sub-graph variable null check logic --- .../last-run/sub-graph-variables-check.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/sub-graph-variables-check.ts b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/sub-graph-variables-check.ts index c1aa175db6..b1150b126b 100644 --- a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/sub-graph-variables-check.ts +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/sub-graph-variables-check.ts @@ -65,11 +65,11 @@ export const useSubGraphVariablesCheck = ({ return { found: false, value: undefined } if (!restPath.length) - return { found: true, value: targetVar.value } + return { found: true, value: targetVar } return { found: true, - value: resolveNestedValue(targetVar.value, restPath), + value: resolveNestedValue(targetVar, restPath), } }, [currentNodeId, nodesWithInspectVars]) @@ -84,9 +84,12 @@ export const useSubGraphVariablesCheck = ({ const { found, value } = getInspectVarValueBySelector(selector) const valueType = value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value const isSubgraphOutput = subGraphNodeIdSet.has(selector[0]) - const isNull = !found - ? isSubgraphOutput - : valueType === 'null' || valueType === 'undefined' + const isValueMissing = valueType === 'null' || valueType === 'undefined' + let isNull = false + if (isSubgraphOutput) + isNull = !found + else if (found) + isNull = isValueMissing if (isNull) return selector }