Skip to content
Permalink
Browse files

Reorder tests in condition to avoid a "index out of range" error

  • Loading branch information...
nado committed Jan 23, 2016
1 parent b46554b commit facb8b0bab0db6a105c808e0a6961d05e3d9d067
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugins/usercommand/middleware.go
@@ -31,7 +31,7 @@ func (m *Middleware) Get(ib *irc.Connection, from string, to string, message str
return
}
cnf := configuration.Config
if !strings.HasPrefix(message, cnf.UserCommandCharacter) || len(message) == 1 {
if len(message) == 1 || !strings.HasPrefix(message, cnf.UserCommandCharacter) {
return
}

0 comments on commit facb8b0

Please sign in to comment.
You can’t perform that action at this time.