From c3c19dda5fe72480ecae4a3a834df69555e2c520 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Tue, 7 May 2013 20:23:35 -0400 Subject: [PATCH] Fixed crash on startup with empty message from server --- bot/handlers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/handlers.go b/bot/handlers.go index b065b88..4cc8d39 100644 --- a/bot/handlers.go +++ b/bot/handlers.go @@ -91,6 +91,9 @@ func (b *Bot) isCmd(message string) (bool, string) { iscmd = true message = message[len(cmdc):] } else if match, _ := regexp.MatchString(rex, lowerMessage); match { + if len(message) < len(botnick) { + return false, message + } iscmd = true message = message[len(botnick):]