fix: avoid crashing

This commit is contained in:
Rain 2023-11-23 11:22:25 +08:00
parent b3dfc939f3
commit e2ed6be305

View File

@ -17,7 +17,7 @@ function useOptions({ filter, isTableOid }: CollectionSelectProps) {
const field: any = useField();
const ctx: any = useContext(FilterContext);
const collection = useCollection();
const targetCollection = isTableOid && (ctx?.field?.collectionName || ctx.collectionName || collection.name);
const targetCollection = isTableOid && (ctx?.field?.collectionName || ctx?.collectionName || collection.name);
const inheritCollections = useSelfAndChildrenCollections(targetCollection);
const { collections = [] } = useCollectionManager();
const currentCollections = field?.dataSource