1
0
Fork 0
forked from External/ergo

fix handling of nil session in reattach code

This commit is contained in:
Shivaram Lingamneni 2019-05-09 05:03:21 -04:00
parent 08ebfb1676
commit 278e4acf57
2 changed files with 5 additions and 2 deletions

View file

@ -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