Don't explode when autocompleting nothing.

Fixes #126.
This commit is contained in:
Andrey Petrov 2015-02-10 12:04:19 -08:00
parent 9979265622
commit 3e54932f7b

View File

@ -199,7 +199,7 @@ func (h *Host) AutoCompleteFunction(u *message.User) func(line string, pos int,
return
}
if strings.HasSuffix(line[:pos], " ") {
if line == "" || strings.HasSuffix(line[:pos], " ") {
// Don't autocomplete spaces.
return
}