From 6da0e2ef46553c004be551d9a66c7ed73b35db3e Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Thu, 17 Aug 2023 14:30:16 +0800 Subject: [PATCH] fix(console): fix Golang guide crash --- .../console/src/mdx-components-v2/UriInputField/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/console/src/mdx-components-v2/UriInputField/index.tsx b/packages/console/src/mdx-components-v2/UriInputField/index.tsx index 0978fd3d7..abd01a26e 100644 --- a/packages/console/src/mdx-components-v2/UriInputField/index.tsx +++ b/packages/console/src/mdx-components-v2/UriInputField/index.tsx @@ -79,8 +79,9 @@ function UriInputField({ name, defaultValue }: Props) { } }; - const defaultValueArray = data?.oidcClientMetadata[name].length - ? data.oidcClientMetadata[name] + const clientMetadata = data?.oidcClientMetadata[name]; + const defaultValueArray = clientMetadata?.length + ? clientMetadata : conditional(defaultValue && [defaultValue]); return (