Fix anarchy crash on empty inputs
This commit is contained in:
parent
dfbe9f6603
commit
58f102af60
@ -196,13 +196,13 @@ async def _(get_input: InputGetter, set_output: OutputSetter):
|
|||||||
await asyncio.sleep(settings.democracy_vote_cycle)
|
await asyncio.sleep(settings.democracy_vote_cycle)
|
||||||
|
|
||||||
inputs: list[Input] = await get_input()
|
inputs: list[Input] = await get_input()
|
||||||
|
|
||||||
the_input = random.choice(inputs)
|
|
||||||
|
|
||||||
if not the_input:
|
if not inputs:
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user