fix(acl): cannot read properties of undefined (reading 'fields')

This commit is contained in:
chenos 2022-11-22 16:00:40 +08:00
parent 466aa4987e
commit 54e92918b2

View File

@ -11,8 +11,8 @@ export const useCollection = () => {
const api = useAPIClient();
const resource = api?.resource(collection?.name);
const { getInheritCollections, getCurrentCollectionFields } = useCollectionManager();
const currentFields = collection.fields;
const inheritKeys = getInheritCollections(collection.name);
const currentFields = collection?.fields || [];
const inheritKeys = getInheritCollections(collection?.name) || [];
const inheritedFields = reduce(
inheritKeys,
(result, value) => {