summaryrefslogtreecommitdiff
path: root/predict
diff options
context:
space:
mode:
Diffstat (limited to 'predict')
-rw-r--r--predict/options.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/predict/options.go b/predict/options.go
index df39437..1c34feb 100644
--- a/predict/options.go
+++ b/predict/options.go
@@ -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 {