From e9d5fa7f9c40c4e02d539dc083eb95d395a002f6 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 8 Apr 2023 14:20:33 +0700 Subject: [PATCH] fix(plugin-workflow): fix null collection fields (#1674) --- packages/plugins/workflow/src/client/variable.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/plugins/workflow/src/client/variable.tsx b/packages/plugins/workflow/src/client/variable.tsx index bf4b2afc1..fe4601dbb 100644 --- a/packages/plugins/workflow/src/client/variable.tsx +++ b/packages/plugins/workflow/src/client/variable.tsx @@ -130,13 +130,14 @@ export function useWorkflowVariableOptions(types?) { return options; } -function useNormallizedFields(collection) { +function useNormallizedFields(collectionName) { const compile = useCompile(); const { getCollection } = useCollectionManager(); + const collection = getCollection(collectionName); if (!collection) { return []; } - const { fields } = getCollection(collection); + const { fields } = collection; const foreignKeyFields: any[] = []; const otherFields: any[] = []; fields.forEach(field => {