From b4c26956ab4096536160a3b497f339d44d937b4c Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Tue, 24 May 2016 10:07:36 -0400 Subject: [PATCH] Fix empty string indexing crash --- plugins/admin/admin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/admin/admin.go b/plugins/admin/admin.go index bf12c81..85988dc 100644 --- a/plugins/admin/admin.go +++ b/plugins/admin/admin.go @@ -36,7 +36,7 @@ func New(bot bot.Bot) *AdminPlugin { func (p *AdminPlugin) Message(message msg.Message) bool { body := message.Body - if body[0] == '$' { + if len(body) > 0 && body[0] == '$' { return p.handleVariables(message) }