From ad25fe704cfd458a01c167c73320a10fe82367ef Mon Sep 17 00:00:00 2001 From: xilesun <2013xile@gmail.com> Date: Wed, 6 Dec 2023 10:09:42 +0800 Subject: [PATCH] fix: issue with SQL collection when the source collection is deleted --- .../templates/components/sql-collection/FieldsConfigure.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/client/src/collection-manager/templates/components/sql-collection/FieldsConfigure.tsx b/packages/core/client/src/collection-manager/templates/components/sql-collection/FieldsConfigure.tsx index e4586af59..99e07f895 100644 --- a/packages/core/client/src/collection-manager/templates/components/sql-collection/FieldsConfigure.tsx +++ b/packages/core/client/src/collection-manager/templates/components/sql-collection/FieldsConfigure.tsx @@ -55,6 +55,9 @@ const useSourceFieldsOptions = () => { }), }; }); + if (!collection) { + return; + } const children = (collection.fields as FieldOptions[]) .filter((v) => !['hasOne', 'hasMany', 'belongsToMany'].includes(v?.type)) ?.map((v) => {