diff --git a/StateMachine/StateMachine.h b/StateMachine/StateMachine.h index a0d0570..0a589a0 100644 --- a/StateMachine/StateMachine.h +++ b/StateMachine/StateMachine.h @@ -18,7 +18,7 @@ class StateMachine :public Graph for (auto&& [new_state, op] : paths) if (op == operation) { - if (callback_map[new_state](derive, state, new_state)) + if (!callback_map.contains(new_state) || callback_map[new_state](derive, state, new_state)) { state = new_state; return true;