diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:45:41 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:45:41 +0200 |
| commit | db71ab17865dd00a60be27bee6c749e0525f72f6 (patch) | |
| tree | 90df7552d23019eae1e36f38dc8d94ceadada72e /src | |
| parent | 30c7e666561cee8deafa25fd424c79b0b801c3fe (diff) | |
FSM: Check if the FSM is defined for transitions and state checks
Diffstat (limited to 'src')
| -rw-r--r-- | src/fsm.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -93,6 +93,10 @@ type FSM struct { } func (eduvpn *VPNState) HasTransition(check FSMStateID) bool { + // No fsm + if eduvpn.FSM == nil { + return false + } for _, transition_state := range eduvpn.FSM.States[eduvpn.FSM.Current] { if transition_state.To == check { return true @@ -103,6 +107,10 @@ func (eduvpn *VPNState) HasTransition(check FSMStateID) bool { } func (eduvpn *VPNState) InState(check FSMStateID) bool { + // No fsm + if eduvpn.FSM == nil { + return false + } return check == eduvpn.FSM.Current } |
