From f63f00732608dbe37ab89a62de5de41152dc3a63 Mon Sep 17 00:00:00 2001 From: SalmonWu13 <121186922+SalmonWu13@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:16:30 +0800 Subject: [PATCH] fix: add null safety checks in webhook response status hook (#12114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What problem does this PR solve? Add optional chaining operators to prevent runtime errors when formData is undefined or null in useShowWebhookResponseStatus hook. This fixes a potential crash when accessing mode and execution_mode properties before formData is initialized or when the Begin node doesn't exist in the graph. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: Claude --- .../pages/agent/form/message-form/use-show-response-status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/agent/form/message-form/use-show-response-status.ts b/web/src/pages/agent/form/message-form/use-show-response-status.ts index 4914f5197..f46e418d0 100644 --- a/web/src/pages/agent/form/message-form/use-show-response-status.ts +++ b/web/src/pages/agent/form/message-form/use-show-response-status.ts @@ -16,7 +16,7 @@ export function useShowWebhookResponseStatus(form: UseFormReturn) { const formData: BeginFormSchemaType = getNode(BeginId)?.data.form; return ( formData?.mode === AgentDialogueMode.Webhook && - formData.execution_mode === WebhookExecutionMode.Streaming + formData?.execution_mode === WebhookExecutionMode.Streaming ); }, [getNode]);