]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #10202 (#10203)
authorrinsuki <428rinsuki+git@gmail.com>
Thu, 7 Mar 2019 00:49:42 +0000 (09:49 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 7 Mar 2019 00:49:42 +0000 (01:49 +0100)
app/views/stream_entries/_poll.html.haml

index c7e5e0c63f68361eb7941c2ba8ba78776a149f81..dad04b79c82852f66e411275cef2c7167ba7a68f 100644 (file)
@@ -7,7 +7,7 @@
     - options.each do |option|
       %li
         - if show_results
-          - percent = 100 * option.votes_count / poll.votes_count
+          - percent = poll.votes_count > 0 ? 100 * option.votes_count / poll.votes_count : 0
           %span.poll__chart{ style: "width: #{percent}%" }
 
           %label.poll__text><