Skip to content

Commit

Permalink
Fix nil completor
Browse files Browse the repository at this point in the history
  • Loading branch information
posener committed Nov 22, 2019
1 parent e8bbd08 commit 0f93c07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion predict/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ func (c Config) Predict(prefix string) []string {
}

func (c Config) Check(value string) error {
if !c.check || c.Predictor == nil {
return nil
}
predictions := c.Predictor.Predict(value)
if !c.check || len(predictions) == 0 {
if len(predictions) == 0 {
return nil
}
for _, vv := range predictions {
Expand Down

0 comments on commit 0f93c07

Please sign in to comment.