🐛 fix(tabsContext.tsx): add null check for flow.data to prevent TypeError
The fix adds a null check for flow.data to prevent a TypeError when accessing the edges property.
This commit is contained in:
parent
c4423e0fc0
commit
3785c7e610
1 changed files with 3 additions and 0 deletions
|
|
@ -90,6 +90,9 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
if (cookie && Object.keys(templates).length > 0) {
|
if (cookie && Object.keys(templates).length > 0) {
|
||||||
let cookieObject: LangFlowState = JSON.parse(cookie);
|
let cookieObject: LangFlowState = JSON.parse(cookie);
|
||||||
cookieObject.flows.forEach((flow) => {
|
cookieObject.flows.forEach((flow) => {
|
||||||
|
if (!flow.data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
flow.data.edges.forEach((edge) => {
|
flow.data.edges.forEach((edge) => {
|
||||||
edge.className = "";
|
edge.className = "";
|
||||||
edge.style = { stroke: "#555555" };
|
edge.style = { stroke: "#555555" };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue