From 7c284019f1e48ddd37b0f047b50564f069caf379 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 20 Apr 2022 17:09:11 +0200 Subject: State: Check if we are Deregistered before initializing FSM --- src/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/state.go b/src/state.go index d8c0075..121ef6d 100644 --- a/src/state.go +++ b/src/state.go @@ -28,10 +28,10 @@ type VPNState struct { } func (state *VPNState) Register(name string, directory string, stateCallback func(string, string, string), debug bool) error { - state.InitializeFSM() if !state.InState(DEREGISTERED) { return errors.New("app already registered") } + state.InitializeFSM() state.Name = name state.ConfigDirectory = directory state.StateCallback = stateCallback -- cgit v1.2.3