Skip to content

Commit e58f415

Browse files
bug fix
1 parent 6f20a19 commit e58f415

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

config/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func Load() error {
141141
return err
142142
}
143143

144-
cfgLocal := Config{}
144+
var cfgLocal *Config
145145
if data != nil {
146146
err = json.Unmarshal(data, &cfgLocal)
147147
if err != nil {
@@ -169,7 +169,11 @@ func Load() error {
169169
}
170170
}
171171

172-
_Config = &cfgLocal
172+
if cfgLocal != nil {
173+
_Config = cfgLocal
174+
} else {
175+
_Config = cfg
176+
}
173177

174178
data, _ = json.Marshal(_Config)
175179
err = db.Put(aggregator.KeyDbConfig, data, nil)

0 commit comments

Comments
 (0)