summaryrefslogtreecommitdiff
path: root/pkg/systray/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/systray/config.go')
-rw-r--r--pkg/systray/config.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/systray/config.go b/pkg/systray/config.go
index e53dea9..2e97456 100644
--- a/pkg/systray/config.go
+++ b/pkg/systray/config.go
@@ -57,12 +57,11 @@ func ParseConfig() *Config {
f, err := os.Open(configPath)
if err != nil {
conf.save()
- return &conf
+ } else {
+ defer f.Close()
+ dec := json.NewDecoder(f)
+ err = dec.Decode(&conf.file)
}
- defer f.Close()
-
- dec := json.NewDecoder(f)
- err = dec.Decode(&conf.file)
conf.SelectGateway = conf.file.SelectGateway
conf.DisableAustostart = conf.file.DisableAustostart