Skip to content

Commit

Permalink
Handle None
Browse files Browse the repository at this point in the history
  • Loading branch information
timgates42 committed Aug 4, 2021
1 parent ea2fc05 commit 5094a70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/meticulous/_websearch.py
Expand Up @@ -90,6 +90,8 @@ def validate_suggestion(suggestion, word):
"""
Make sure suggestions are not much longer than the original word
"""
if suggestion is None:
return None
if len(suggestion.replacement) > len(word) * 2:
return Suggestion(is_typo=True)
return suggestion
Expand Down

0 comments on commit 5094a70

Please sign in to comment.