mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 18:09:21 +08:00
fix: undefined match the wrong output schema (#25971)
This commit is contained in:
@@ -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 : ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user