summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2020-10-08 17:25:54 +0200
committerRuben Pollan <meskio@sindominio.net>2020-10-08 17:32:56 +0200
commitd641b7a63e2b2dab56c7da3bb3b6e6bcd3daefd4 (patch)
treef1bda1f75e79ab30c2395984803f7b8c92d16a02
parent9980d38b1fbd72b6bfe2ab07fbdec6350c21e3ea (diff)
[bug] don't crash on quit if no autostart
-rw-r--r--pkg/backend/api.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index b78605e..1d44f8a 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -48,7 +48,9 @@ func SwitchOff() {
}
func Quit() {
- ctx.autostart.Disable()
+ if ctx.autostart != nil {
+ ctx.autostart.Disable()
+ }
if ctx.Status != off {
go setStatus(stopping)
ctx.cfg.SetUserStoppedVPN(false)