Created
November 21, 2010 19:14
-
-
Save soul9/709046 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/irc_callback.go b/irc_callback.go | |
index fead866..d68f92b 100644 | |
--- a/irc_callback.go | |
+++ b/irc_callback.go | |
@@ -31,7 +31,7 @@ func (irc *IRCConnection) ReplaceCallback(eventcode string, i int, callback func | |
} | |
func (irc *IRCConnection) RunCallbacks(event *IRCEvent) { | |
- if event.Code == "PRIVMSG" && event.Message[0] == '\x01' { | |
+ if event.Code == "PRIVMSG" && len(event.Message) > 0 && event.Message[0] == '\x01' { | |
event.Code = "CTCP" //Unknown CTCP | |
if i := strings.LastIndex(event.Message, "\x01"); i > -1 { | |
event.Message = event.Message[1:i] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment