From 162e0cc71d9fd643c0b9b8fc247de7acc64fb018 Mon Sep 17 00:00:00 2001 From: Dennis Collaris <d.collaris@me.com> Date: Tue, 8 Oct 2024 12:37:42 +0200 Subject: [PATCH] fix: type issue in insertvariablesplugin --- .../components/textEditor/plugins/InsertVariablesPlugin.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/shared/lib/components/textEditor/plugins/InsertVariablesPlugin.tsx b/libs/shared/lib/components/textEditor/plugins/InsertVariablesPlugin.tsx index baa419ee2..77824221f 100644 --- a/libs/shared/lib/components/textEditor/plugins/InsertVariablesPlugin.tsx +++ b/libs/shared/lib/components/textEditor/plugins/InsertVariablesPlugin.tsx @@ -33,9 +33,9 @@ export const InsertVariablesPlugin = () => { const nodeTypes = Object.keys(result.metaData?.nodes.types || {}); function optionsForType(type: string) { - const typeObj = result.metaData?.nodes.types[type] ?? {}; + const typeObj = result.metaData?.nodes.types[type] ?? {attributes: null}; - if (!('attributes' in typeObj)) { + if (!('attributes' in typeObj) || typeObj.attributes == null) { return []; } -- GitLab