diff --git a/packages/core/client/src/collection-manager/mixins/InheritanceCollectionMixin.ts b/packages/core/client/src/collection-manager/mixins/InheritanceCollectionMixin.ts index fb199d692..3f9549c27 100644 --- a/packages/core/client/src/collection-manager/mixins/InheritanceCollectionMixin.ts +++ b/packages/core/client/src/collection-manager/mixins/InheritanceCollectionMixin.ts @@ -193,7 +193,7 @@ export class InheritanceCollectionMixin extends Collection { }; this.allCollectionsInheritChain = getInheritChain(this.name); - return this.allCollectionsInheritChain; + return this.allCollectionsInheritChain || []; } getInheritCollectionsChain() { diff --git a/packages/core/client/src/schema-settings/DataTemplates/hooks/useCollectionState.ts b/packages/core/client/src/schema-settings/DataTemplates/hooks/useCollectionState.ts index 894841639..5beb6deb8 100644 --- a/packages/core/client/src/schema-settings/DataTemplates/hooks/useCollectionState.ts +++ b/packages/core/client/src/schema-settings/DataTemplates/hooks/useCollectionState.ts @@ -26,7 +26,7 @@ export const useCollectionState = (currentCollectionName: string) => { const templateField: any = useField(); function getCollectionList() { - const collections = getAllCollectionsInheritChain(currentCollectionName); + const collections = getAllCollectionsInheritChain(currentCollectionName) || []; return collections.map((name) => ({ label: getCollection(name)?.title, value: name })); }