1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2026-04-17 10:00:57 +02:00

Fiction.live: Fix choices array check

Fixes #29
This commit is contained in:
David Lynch 2019-11-05 15:02:09 -06:00
parent 685120b17d
commit f89f5163b5

View file

@ -64,7 +64,7 @@ class FictionLive(Site):
if type(votechoices) == int:
votechoices = (votechoices,)
for choice in votechoices:
if int(choice) in segment['choices']:
if int(choice) < len(segment['choices']):
# sometimes someone has voted for a presumably-deleted choice
choice = segment['choices'][int(choice)]
votes[choice] = votes.get(choice, 0) + 1