Fix empty string indexing crash

This commit is contained in:
Chris Sexton 2016-05-24 10:07:36 -04:00
parent 078eea0ca3
commit b4c26956ab
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ func New(bot bot.Bot) *AdminPlugin {
func (p *AdminPlugin) Message(message msg.Message) bool { func (p *AdminPlugin) Message(message msg.Message) bool {
body := message.Body body := message.Body
if body[0] == '$' { if len(body) > 0 && body[0] == '$' {
return p.handleVariables(message) return p.handleVariables(message)
} }