diff --git a/web/app/components/workflow/nodes/agent/default.ts b/web/app/components/workflow/nodes/agent/default.ts index 2720589d6e..6069f90991 100644 --- a/web/app/components/workflow/nodes/agent/default.ts +++ b/web/app/components/workflow/nodes/agent/default.ts @@ -57,11 +57,11 @@ const nodeDefault: NodeDefault = { } // check form of tool else { - const schemas = toolValue.schemas + const schemas = toolValue.schemas || [] const userSettings = toolValue.settings const reasoningConfig = toolValue.parameters schemas.forEach((schema: any) => { - if (schema.required) { + if (schema?.required) { if (schema.form === 'form' && !userSettings[schema.name]?.value) { return { isValid: false, @@ -102,11 +102,11 @@ const nodeDefault: NodeDefault = { errorMessage: '', } for (const tool of tools) { - const schemas = tool.schemas + const schemas = tool.schemas || [] const userSettings = tool.settings const reasoningConfig = tool.parameters schemas.forEach((schema: any) => { - if (schema.required) { + if (schema?.required) { if (schema.form === 'form' && !userSettings[schema.name]?.value) { return validState = { isValid: false, diff --git a/web/app/components/workflow/nodes/if-else/default.ts b/web/app/components/workflow/nodes/if-else/default.ts index 918a5c59d8..1be80592e5 100644 --- a/web/app/components/workflow/nodes/if-else/default.ts +++ b/web/app/components/workflow/nodes/if-else/default.ts @@ -1,7 +1,6 @@ import { BlockEnum, type NodeDefault } from '../../types' import { type IfElseNodeType, LogicalOperator } from './types' import { isEmptyRelatedOperator } from './utils' -import { TransferMethod } from '@/types/app' import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/blocks' const i18nPrefix = 'workflow.errorMsg'