3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +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) casefoldedChannelName, err := CasefoldChannel(channelName)
channel := server.channels.Get(casefoldedChannelName) channel := server.channels.Get(casefoldedChannelName)
if err != nil || channel == nil { if err != nil || channel == nil {
client.Send(nil, server.name, RPL_INVITING, client.nick, target.nick, channelName) client.Send(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, channelName, "No such channel")
target.Send(nil, client.nickMaskString, "INVITE", target.nick, channel.name) return false
return true
} }
channel.Invite(target, client) channel.Invite(target, client)