From 6ce1e34c2169a3ba454b4fdd632ec64ea6d0a886 Mon Sep 17 00:00:00 2001 From: Thomas Jager Date: Fri, 31 Jul 2015 13:03:09 +0200 Subject: [PATCH] Don't crash on empty ACTION --- irc_callback.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/irc_callback.go b/irc_callback.go index 4b71b3b..fad0d11 100644 --- a/irc_callback.go +++ b/irc_callback.go @@ -104,7 +104,11 @@ func (irc *Connection) RunCallbacks(event *Event) { } else if strings.HasPrefix(msg, "ACTION") { event.Code = "CTCP_ACTION" - msg = msg[7:] + if len(msg) > 6 { + msg = msg[7:] + } else { + msg = "" + } } event.Arguments[len(event.Arguments)-1] = msg