Fixed crash on startup with empty message from server

This commit is contained in:
Chris Sexton 2013-05-07 20:23:35 -04:00
parent 42c934f091
commit c3c19dda5f
1 changed files with 3 additions and 0 deletions

View File

@ -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):]