diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index c3b10da72..b646acfc1 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -980,7 +980,7 @@ export const useAssociationFilterBlockProps = () => { const fieldSchema = useFieldSchema(); const optionalFieldList = useOptionalFieldList(); const { getDataBlocks } = useFilterBlock(); - const collectionFieldName = collectionField.name; + const collectionFieldName = collectionField?.name; const field = useField(); let list, handleSearchInput, params, run, data, valueKey, labelKey, filterKey; diff --git a/packages/core/client/src/collection-manager/hooks/useCollection.ts b/packages/core/client/src/collection-manager/hooks/useCollection.ts index 1b4d47005..ced71ea95 100644 --- a/packages/core/client/src/collection-manager/hooks/useCollection.ts +++ b/packages/core/client/src/collection-manager/hooks/useCollection.ts @@ -29,7 +29,7 @@ export const useCollection = () => { return { ...collection, resource, - getField(name: SchemaKey): CollectionFieldOptions | null { + getField(name: SchemaKey): CollectionFieldOptions | undefined { const fields = totalFields as any[]; return fields?.find((field) => field.name === name); },