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,6 +32,8 @@ def validate(keyword, target):
|
|||
|
||||
# check if keyword is in number_keyword list
|
||||
elif keyword in StaticAnswers().keys('number_keywords'):
|
||||
# prevent AttributeError if target is NoneType
|
||||
if target is not None:
|
||||
# if target only consists of digits return True
|
||||
return target.isdigit()
|
||||
|
||||
|
|
Loading…
Reference in a new issue