mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 07:26:47 +08:00
fix: add null safety checks in webhook response status hook (#12114)
### 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 <noreply@anthropic.com>
This commit is contained in:
@ -16,7 +16,7 @@ export function useShowWebhookResponseStatus(form: UseFormReturn<any>) {
|
||||
const formData: BeginFormSchemaType = getNode(BeginId)?.data.form;
|
||||
return (
|
||||
formData?.mode === AgentDialogueMode.Webhook &&
|
||||
formData.execution_mode === WebhookExecutionMode.Streaming
|
||||
formData?.execution_mode === WebhookExecutionMode.Streaming
|
||||
);
|
||||
}, [getNode]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user