Fix anarchy crash on empty inputs

This commit is contained in:
Dominic Zimmer 2022-10-30 11:44:03 +01:00
parent dfbe9f6603
commit 58f102af60

View File

@ -197,12 +197,12 @@ async def _(get_input: InputGetter, set_output: OutputSetter):
inputs: list[Input] = await get_input() inputs: list[Input] = await get_input()
the_input = random.choice(inputs) if not inputs:
if not the_input:
set_output(EMPTY_INPUT) set_output(EMPTY_INPUT)
continue continue
the_input = random.choice(inputs)
output = {button: the_input[button] for button in Button} output = {button: the_input[button] for button in Button}
set_output(output) set_output(output)