diff --git a/packages/antd/src/array-base/index.tsx b/packages/antd/src/array-base/index.tsx index 26e0101d679..dfc49141c99 100644 --- a/packages/antd/src/array-base/index.tsx +++ b/packages/antd/src/array-base/index.tsx @@ -107,8 +107,8 @@ const getSchemaDefaultValue = (schema: Schema) => { const getDefaultValue = (defaultValue: any, schema: Schema) => { if (isValid(defaultValue)) return clone(defaultValue) if (Array.isArray(schema?.items)) - return getSchemaDefaultValue(schema.items[0]) - return getSchemaDefaultValue(schema.items) + return getSchemaDefaultValue(schema?.items[0]) + return getSchemaDefaultValue(schema?.items) } export const ArrayBase: ComposedArrayBase = (props) => { diff --git a/packages/next/src/array-base/index.tsx b/packages/next/src/array-base/index.tsx index d73ce31101e..125431725bf 100644 --- a/packages/next/src/array-base/index.tsx +++ b/packages/next/src/array-base/index.tsx @@ -107,8 +107,8 @@ const getSchemaDefaultValue = (schema: Schema) => { const getDefaultValue = (defaultValue: any, schema: Schema) => { if (isValid(defaultValue)) return clone(defaultValue) if (Array.isArray(schema?.items)) - return getSchemaDefaultValue(schema.items[0]) - return getSchemaDefaultValue(schema.items) + return getSchemaDefaultValue(schema?.items[0]) + return getSchemaDefaultValue(schema?.items) } export const ArrayBase: ComposedArrayBase = (props) => {