Skip to content

Commit

Permalink
fix: check suggestions slice length (#251)
Browse files Browse the repository at this point in the history
Co-authored-by: Asdine El Hrychy <[email protected]>
  • Loading branch information
tdakkota and asdine authored Oct 14, 2020
1 parent f5afd65 commit 375ed7a
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 @@ -472,7 +472,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 suggestions
}
expected := e.Expected
Expand Down

0 comments on commit 375ed7a

Please sign in to comment.