bug, IgnorePersistentKeepalive may be absent

This commit is contained in:
vx3r 2020-03-18 16:16:14 +09:00
parent 200e47b708
commit 8a79426e2f
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,11 @@ func MigratePresharedKey() error {
c.Name = client["name"].(string)
c.Email = client["email"].(string)
c.Enable = client["enable"].(bool)
c.IgnorePersistentKeepalive = client["ignorePersistentKeepalive"].(bool)
if val, ok := client["ignorePersistentKeepalive"]; ok {
c.IgnorePersistentKeepalive = val.(bool)
} else {
c.IgnorePersistentKeepalive = false
}
c.PresharedKey = s["presharedKey"].(string)
c.AllowedIPs = make([]string, 0)
for _, address := range client["allowedIPs"].([]interface{}) {