From df9ece79e308efcf7de71cc958483c49fbe8cbcf Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Sat, 31 Aug 2013 18:44:25 +0100 Subject: [PATCH] Small tidy up in Server.handleEvent() --- server.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 663adf4..5b9b492 100644 --- a/server.go +++ b/server.go @@ -323,13 +323,15 @@ func (s *Server) handleEvent(e Event) { reason := strings.Join(args[1:], " ") - if client, exists := s.clientMap[strings.ToLower(nick)]; exists { - client.reply(rplKill, e.client.nick, reason) - client.disconnect() - } else { + client, exists := s.clientMap[strings.ToLower(nick)] + if !exists { e.client.reply(errNoSuchNick, nick) + return } + client.reply(rplKill, e.client.nick, reason) + client.disconnect() + case command == "KICK": if e.client.registered == false { e.client.reply(errNotReg)