mirror of
https://github.com/jeremyd/ergo.git
synced 2026-05-13 20:48:35 -07:00
fix #1898
NS SAREGISTER would fail due to a nil dereference of `client`; add two safeguards against this.
This commit is contained in:
@@ -474,8 +474,10 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames
|
|||||||
am.Unregister(casefoldedAccount, true)
|
am.Unregister(casefoldedAccount, true)
|
||||||
return ®istrationCallbackError{underlying: err}
|
return ®istrationCallbackError{underlying: err}
|
||||||
} else {
|
} else {
|
||||||
am.server.logger.Info("accounts",
|
if client != nil && code != "" {
|
||||||
fmt.Sprintf("nickname %s registered account %s, pending verification", client.Nick(), account))
|
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 {
|
return am.server.store.Update(func(tx *buntdb.Tx) error {
|
||||||
_, _, err = tx.Set(verificationCodeKey, code, setOptions)
|
_, _, err = tx.Set(verificationCodeKey, code, setOptions)
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user