From 4c27747416a56e09029fe5de776afc2b2071f1de Mon Sep 17 00:00:00 2001 From: muchtea Date: Wed, 7 Oct 2020 02:31:57 +0200 Subject: [PATCH] fiction.live - handle api returning non-int values for votes comment --- fanficfare/adapters/adapter_fictionlive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fanficfare/adapters/adapter_fictionlive.py b/fanficfare/adapters/adapter_fictionlive.py index f2f02a35..cb44abd8 100644 --- a/fanficfare/adapters/adapter_fictionlive.py +++ b/fanficfare/adapters/adapter_fictionlive.py @@ -386,6 +386,10 @@ class FictionLiveAdapter(BaseSiteAdapter): if 'multiple' in chunk and chunk['multiple'] == False: vote = [vote] # normalize to list for v in vote: + # v should only be int, but there is at least one story where some unrelated string was returned, + # so let's just ignore non-int values here + if not isinstance(v, int): + continue if 0 <= v <= len(choices): output[v] += 1 return output