Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: undefined match the wrong output schema (#25971)

Joel1550316b8d75
diff --git a/web/app/components/workflow/nodes/_base/components/variable/use-match-schema-type.ts b/web/app/components/workflow/nodes/_base/components/variable/use-match-schema-type.ts
index fdde6685ded..2c0c91b7f50 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/use-match-schema-type.ts
+++ b/web/app/components/workflow/nodes/_base/components/variable/use-match-schema-type.ts
@@ -4,7 +4,7 @@ import type { AnyObj } from './match-schema-type'
import matchTheSchemaType from './match-schema-type'
export const getMatchedSchemaType = (obj: AnyObj, schemaTypeDefinitions?: SchemaTypeDefinition[]): string => {
- if(!schemaTypeDefinitions) return ''
+ if(!schemaTypeDefinitions || obj === undefined || obj === null) return ''
const matched = schemaTypeDefinitions.find(def => matchTheSchemaType(obj, def.schema))
return matched ? matched.name : ''
}