From 75f620db198071eb2af98032c6d33804eb88503f Mon Sep 17 00:00:00 2001 From: bchao1 Date: Sun, 13 Sep 2020 12:46:42 +0800 Subject: [PATCH] fix encounter NoneType in Input valid() --- bullet/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bullet/client.py b/bullet/client.py index c120e84..be3b061 100644 --- a/bullet/client.py +++ b/bullet/client.py @@ -426,6 +426,8 @@ def __init__( self.pattern = pattern def valid(self, ans): + if ans is None: + return False if not bool(re.match(self.pattern, ans)): utils.moveCursorUp(1) utils.forceWrite(' ' * self.indent + self.prompt + self.default)