Check if server exists in storage.User.SetNick()
This commit is contained in:
parent
06977c9b44
commit
326161a563
@ -165,11 +165,14 @@ func (u *User) SetNick(nick, address string) {
|
||||
id := u.serverID(address)
|
||||
|
||||
server := Server{}
|
||||
server.Unmarshal(b.Get(id))
|
||||
v := b.Get(id)
|
||||
if v != nil {
|
||||
server.Unmarshal(v)
|
||||
server.Nick = nick
|
||||
|
||||
data, _ := server.Marshal(nil)
|
||||
b.Put(id, data)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user