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)
|
id := u.serverID(address)
|
||||||
|
|
||||||
server := Server{}
|
server := Server{}
|
||||||
server.Unmarshal(b.Get(id))
|
v := b.Get(id)
|
||||||
server.Nick = nick
|
if v != nil {
|
||||||
|
server.Unmarshal(v)
|
||||||
|
server.Nick = nick
|
||||||
|
|
||||||
data, _ := server.Marshal(nil)
|
data, _ := server.Marshal(nil)
|
||||||
b.Put(id, data)
|
b.Put(id, data)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user