From 450e34d42ce1df2068db20efb767905ac85cea14 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Tue, 5 Mar 2024 21:30:58 +0100 Subject: [PATCH] Silent invalid states when building a graph --- src/fsm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsm.js b/src/fsm.js index e0ac974..a81cdfa 100644 --- a/src/fsm.js +++ b/src/fsm.js @@ -47,7 +47,7 @@ export function openAutomaton(states, editable = false) { */ function updateUIState() { wordInput.value = builder; - if (typeof Array.from(state).find((state) => states[state].accepting) === 'undefined') { + if (typeof Array.from(state).find((state) => states[state]?.accepting) === 'undefined') { light.classList.remove(IS_VALID); light.classList.add(IS_INVALID); } else {