From 5d42acf28d2e140727047b78e17527e886926a10 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 10 Jul 2023 16:41:23 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.ts):=20add=20optional?= =?UTF-8?q?=20chaining=20to=20reactFlowInstance.getNode()=20to=20handle=20?= =?UTF-8?q?cases=20where=20reactFlowInstance=20is=20null=20or=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 4fc7cb016..d44bdf5e6 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -598,7 +598,7 @@ export function isValidConnection( ) || targetHandle.split("|")[0] === "str" ) { - let targetNode = reactFlowInstance.getNode(target).data.node; + let targetNode = reactFlowInstance?.getNode(target)?.data?.node; if (!targetNode) { if ( !reactFlowInstance