Skip to content

Commit daccdc5

Browse files
authored
Size check actions array in StateGraph (#676)
1 parent 7aa255a commit daccdc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nflow-explorer/src/component/StateGraph.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ function createGraph(props) {
4444
//when we have two actions in sequence that match the from state and the to state we return true
4545
const actions = instance.actions;
4646

47+
if (actions.length === 0) {
48+
return false;
49+
}
50+
4751
for (let i = 0; i < actions.length - 1; i++) {
4852
// Check if the current action state matches the toState (since it's reversed)
4953
if (actions[i].state === toState && actions[i + 1].state === fromState) {

0 commit comments

Comments
 (0)