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: fix Cannot read properties of null (reading 'credential_form_sch… (#31117)

wangxiaolei8724ba04aa39
diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-model-form-schemas.ts b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-model-form-schemas.ts
index 0345781592b..edc1774f020 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-model-form-schemas.ts
+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-model-form-schemas.ts
@@ -25,9 +25,10 @@ export const useModelFormSchemas = (
model_credential_schema,
} = provider
const formSchemas = useMemo(() => {
- return providerFormSchemaPredefined
- ? provider_credential_schema.credential_form_schemas
- : model_credential_schema.credential_form_schemas
+ const schemas = providerFormSchemaPredefined
+ ? provider_credential_schema?.credential_form_schemas
+ : model_credential_schema?.credential_form_schemas
+ return Array.isArray(schemas) ? schemas : []
}, [
providerFormSchemaPredefined,
provider_credential_schema?.credential_form_schemas,