mirror of
https://github.com/mightyBroccoli/xmpp-chatbot.git
synced 2024-12-04 14:23:36 +01:00
NoneType isdigit Hotfix
* fix AttributeError if isdigit is called on a NoneType object
This commit is contained in:
parent
56e7e6861f
commit
a4ab459c05
1 changed files with 4 additions and 2 deletions
|
@ -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"):
|
||||
|
|
Loading…
Reference in a new issue