diff options
Diffstat (limited to 'common')
-rwxr-xr-x | common/misc.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/misc.py b/common/misc.py index 86798b8..b91c618 100755 --- a/common/misc.py +++ b/common/misc.py @@ -32,8 +32,10 @@ def validate(keyword, target): # check if keyword is in number_keyword list elif keyword in StaticAnswers().keys('number_keywords'): - # if target only consists of digits return True - return target.isdigit() + # prevent AttributeError if target is NoneType + if target is not None: + # if target only consists of digits return True + return target.isdigit() # if keyword is in no_arg_keywords list return True elif keyword in StaticAnswers().keys("no_arg_keywords"): |