From c254021dd8c5fcf5864f993710f2a77d00430223 Mon Sep 17 00:00:00 2001 From: huanmie Date: Wed, 20 Jul 2022 06:41:42 +0800 Subject: [PATCH] Add: check for RegisterCallback --- StateMachine/StateMachine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;