From 3785c7e61002b3137a1b2aa6755dd57f9674e58d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 8 Jun 2023 16:54:46 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(tabsContext.tsx):=20add=20nu?= =?UTF-8?q?ll=20check=20for=20flow.data=20to=20prevent=20TypeError=20The?= =?UTF-8?q?=20fix=20adds=20a=20null=20check=20for=20flow.data=20to=20preve?= =?UTF-8?q?nt=20a=20TypeError=20when=20accessing=20the=20edges=20property.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/contexts/tabsContext.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 1d7ad43d5..2c3c0327d 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -90,6 +90,9 @@ export function TabsProvider({ children }: { children: ReactNode }) { if (cookie && Object.keys(templates).length > 0) { let cookieObject: LangFlowState = JSON.parse(cookie); cookieObject.flows.forEach((flow) => { + if (!flow.data) { + return; + } flow.data.edges.forEach((edge) => { edge.className = ""; edge.style = { stroke: "#555555" };