From eecefdb2358a4552baaf0c646d325424aeead180 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 10 Jul 2023 15:47:02 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(formModal):=20handle=20case?= =?UTF-8?q?=20when=20chatKey=20is=20undefined=20to=20prevent=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/modals/formModal/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index f8dba0f37..7a5dae1a6 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -554,6 +554,8 @@ export default function FormModal({ setChatValue={(value) => { setChatValue(value); setTabsState((old) => { + // chatKey is undefined when there are no chat input keys + if (!chatKey) return old; let newTabsState = _.cloneDeep(old); newTabsState[id.current].formKeysData.input_keys[ chatKey