fix bad patch for bounds check in previous

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
mappu 2017-05-28 13:38:56 +12:00
parent 53b72e0cb0
commit d21b18fc75

View File

@ -133,12 +133,12 @@ func (s *Server) RunWorker() {
// Client sent a command // Client sent a command
fields := strings.Fields(string(line)) fields := strings.Fields(string(line))
if len(fields) < 2 { if len(fields) == 0 {
return return
} }
if strings.HasPrefix(fields[0], ":") { if strings.HasPrefix(fields[0], ":") {
fields = fields[1:] fields[0] = fields[0][1:]
} }
s.handleCommand(strings.ToUpper(fields[0]), fields[1:]) s.handleCommand(strings.ToUpper(fields[0]), fields[1:])