Fix #727 - use default parental sensitivity when it's not set

This commit is contained in:
Andrey Meshkov
2019-06-06 22:42:17 +03:00
parent f9807e4011
commit 07db927246
4 changed files with 14 additions and 9 deletions

View File

@@ -89,13 +89,13 @@ func clientExists(ip string) bool {
}
// Search for a client by IP
func clientFind(ip string) (Client, bool) {
func clientFind(ip string) (*Client, bool) {
clients.lock.Lock()
defer clients.lock.Unlock()
c, ok := clients.ipIndex[ip]
if ok {
return *c, true
return c, true
}
for _, c = range clients.list {
@@ -109,12 +109,12 @@ func clientFind(ip string) (Client, bool) {
continue
}
if ip == ipAddr.String() {
return *c, true
return c, true
}
}
}
return Client{}, false
return nil, false
}
// Check if Client object's fields are correct