mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-15 00:19:29 +01:00
fix #1898
NS SAREGISTER would fail due to a nil dereference of `client`; add two safeguards against this.
This commit is contained in:
parent
8605cd2295
commit
3162c8a1c8
@ -474,8 +474,10 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames
|
||||
am.Unregister(casefoldedAccount, true)
|
||||
return ®istrationCallbackError{underlying: err}
|
||||
} else {
|
||||
am.server.logger.Info("accounts",
|
||||
fmt.Sprintf("nickname %s registered account %s, pending verification", client.Nick(), account))
|
||||
if client != nil && code != "" {
|
||||
am.server.logger.Info("accounts",
|
||||
fmt.Sprintf("nickname %s registered account %s, pending verification", client.Nick(), account))
|
||||
}
|
||||
return am.server.store.Update(func(tx *buntdb.Tx) error {
|
||||
_, _, err = tx.Set(verificationCodeKey, code, setOptions)
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user