3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 02:32:39 +01:00

INVITE: Fix dumb crash (thanks for pointing this out, @josephbisch!)

This commit is contained in:
Daniel Oaks 2017-10-10 11:17:41 +10:00
parent 79325d333e
commit 2791476f16

View File

@ -2019,9 +2019,8 @@ func inviteHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
casefoldedChannelName, err := CasefoldChannel(channelName)
channel := server.channels.Get(casefoldedChannelName)
if err != nil || channel == nil {
client.Send(nil, server.name, RPL_INVITING, client.nick, target.nick, channelName)
target.Send(nil, client.nickMaskString, "INVITE", target.nick, channel.name)
return true
client.Send(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, channelName, "No such channel")
return false
}
channel.Invite(target, client)