From a4ab459c054f56243b5b775bb773ebec578385f6 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 11 Nov 2018 04:00:16 +0100 Subject: NoneType isdigit Hotfix * fix AttributeError if isdigit is called on a NoneType object --- common/misc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common') 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"): -- cgit v1.2.3-54-g00ecf