From fbafd03ea9c544fdd52096bbf07f9e28fd22f556 Mon Sep 17 00:00:00 2001 From: Romain J Date: Fri, 5 Jun 2020 00:36:20 +0200 Subject: [PATCH] fix(setup): prevent case when user fill nothinf in multiple `get_multiple` --- tuxbot/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tuxbot/setup.py b/tuxbot/setup.py index 280da2d..e56a7d1 100644 --- a/tuxbot/setup.py +++ b/tuxbot/setup.py @@ -219,7 +219,11 @@ def get_multiple(question: str, confirmation: str, value_type: type)\ List containing user filled values. """ print(question) - values = [value_type(input('> '))] + user_input = input('> ') + if not user_input: + return [] + + values = [user_input] while click.confirm(confirmation, default=False): values.append(value_type(input('> ')))