Skip to content

Commit

Permalink
fix: check suggestions slice length
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Oct 11, 2020
1 parent 789f2e2 commit 17cfceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/genji/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (sh *Shell) completer(in prompt.Document) []prompt.Suggest {
_, err := parser.NewParser(strings.NewReader(in.Text)).ParseQuery(context.Background())
if err != nil {
e, ok := err.(*parser.ParseError)
if !ok {
if !ok || len(e.Expected) < 1 {
return []prompt.Suggest{}
}
expected := e.Expected
Expand Down

0 comments on commit 17cfceb

Please sign in to comment.