Don't try to use an undefined transition list

This commit is contained in:
2024-03-25 21:12:10 +01:00
parent b4e06d05c5
commit fc555efbc0

View File

@@ -95,9 +95,11 @@ export function openAutomaton(name, states, editable = false) {
for (const s of state) { for (const s of state) {
if (s in states) { if (s in states) {
const transitions = states[s].transitions[letter]; const transitions = states[s].transitions[letter];
if (transitions) {
newStates.push(...transitions); newStates.push(...transitions);
} }
} }
}
state = newStates; state = newStates;
updateUIState(); updateUIState();
} }