mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-29 10:18:11 -07:00
fix handling of nil session in reattach code
This commit is contained in:
@@ -152,7 +152,7 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
||||
|
||||
currentClient := clients.byNick[newcfnick]
|
||||
// the client may just be changing case
|
||||
if currentClient != nil && currentClient != client {
|
||||
if currentClient != nil && currentClient != client && session != nil {
|
||||
// these conditions forbid reattaching to an existing session:
|
||||
if client.Registered() || !bouncerAllowed || account == "" || account != currentClient.Account() || client.isTor != currentClient.isTor || client.HasMode(modes.TLS) != currentClient.HasMode(modes.TLS) {
|
||||
return errNicknameInUse
|
||||
|
||||
Reference in New Issue
Block a user