diff --git a/files/classes/submission.py b/files/classes/submission.py index a722ad56d1..3c3afaaa13 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -397,10 +397,11 @@ class Submission(Base): if not self.total_poll_voted(v): body += ' d-none' body += f'"> - {c.upvotes} votes' - curr = self.total_choice_voted(v) - if curr: curr = " value=" + str(curr[0].comment_id) - else: curr = '' - body += f'' + if self.choices: + curr = self.total_choice_voted(v) + if curr: curr = " value=" + str(curr[0].comment_id) + else: curr = '' + body += f'' for c in self.choices: body += f'''