Don't crash on empty ACTION

This commit is contained in:
Thomas Jager 2015-07-31 13:03:09 +02:00
parent c47f9d8e3d
commit 6ce1e34c21

View File

@ -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