summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-07 13:45:51 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commitd261b243fecc6ff583461cc839e07194185cba95 (patch)
treeae88c17314e8d1c22a18579385bbcfd688e0d0c9 /internal
parentfe5f8c80298e46a6940e3ad087f559942edb4a06 (diff)
FSM: Allow to always go to deregistered
Diffstat (limited to 'internal')
-rw-r--r--internal/fsm/fsm.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/fsm/fsm.go b/internal/fsm/fsm.go
index 1b38e3a..f5bebd7 100644
--- a/internal/fsm/fsm.go
+++ b/internal/fsm/fsm.go
@@ -98,7 +98,9 @@ func (fsm *FSM) InState(check StateID) bool {
}
func (fsm *FSM) CheckTransition(desired StateID) error {
- if desired == fsm.initial {
+ // initial or begin state is fine
+ // 0 = deregistered
+ if desired == fsm.initial || desired == 0 {
return nil
}
for _, ts := range fsm.States[fsm.Current].Transitions {