From 163a76eb6eff249fd0560d046e95f81f6673ca34 Mon Sep 17 00:00:00 2001 From: hzhufa <46232940+hzhufa@users.noreply.github.com> Date: Thu, 8 May 2025 12:57:10 +0800 Subject: [PATCH] Bug fix: Invalid edge connection data causes the page to crash. (#19369) Co-authored-by: hzhufa --- .../hooks/use-workflow-run-event/use-workflow-node-started.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-node-started.ts b/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-node-started.ts index b537ccbb27..f1f184d4bb 100644 --- a/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-node-started.ts +++ b/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-node-started.ts @@ -67,6 +67,9 @@ export const useWorkflowNodeStarted = () => { incomeEdges.forEach((edge) => { const incomeNode = nodes.find(node => node.id === edge.source)! + if (!incomeNode || !('data' in incomeNode)) + return + if ( (!incomeNode.data._runningBranchId && edge.sourceHandle === 'source') || (incomeNode.data._runningBranchId && edge.sourceHandle === incomeNode.data._runningBranchId)