rinsuki 5 년 전
부모
커밋
f44091d653
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/views/stream_entries/_poll.html.haml

+ 1 - 1
app/views/stream_entries/_poll.html.haml

@@ -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><