Skip to content

Instantly share code, notes, and snippets.

@mdellavo
Last active February 21, 2017 18:24
Show Gist options
  • Save mdellavo/08bbe0a245860d8f7d994069d874a8f9 to your computer and use it in GitHub Desktop.
Save mdellavo/08bbe0a245860d8f7d994069d874a8f9 to your computer and use it in GitHub Desktop.
diff --git a/scumbag/scumbag.go b/scumbag/scumbag.go
index 1314abe..195c7e1 100644
--- a/scumbag/scumbag.go
+++ b/scumbag/scumbag.go
@@ -241,6 +241,9 @@ func (bot *Scumbag) processCommands(line *irc.Line) {
func (bot *Scumbag) getCommand(line *irc.Line) (string, string) {
fields := strings.Fields(line.Args[1])
+ if len(fields) == 0 {
+ return "", ""
+ }
command := fields[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment