Skip to content

Commit 75f620d

Browse files
committed
fix encounter NoneType in Input valid()
1 parent 30cf0e3 commit 75f620d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bullet/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ def __init__(
426426
self.pattern = pattern
427427

428428
def valid(self, ans):
429+
if ans is None:
430+
return False
429431
if not bool(re.match(self.pattern, ans)):
430432
utils.moveCursorUp(1)
431433
utils.forceWrite(' ' * self.indent + self.prompt + self.default)

0 commit comments

Comments
 (0)