summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/poll.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/poll.pm')
-rw-r--r--IkiWiki/Plugin/poll.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm
index b862ccdaa..e92d0292f 100644
--- a/IkiWiki/Plugin/poll.pm
+++ b/IkiWiki/Plugin/poll.pm
@@ -45,7 +45,7 @@ sub preprocess (@) { #{{{
my $ret="";
foreach my $choice (@choices) {
- my $percent=int($choices{$choice} / $total * 100);
+ my $percent=$total > 0 ? int($choices{$choice} / $total * 100) : 0;
if ($percent) {
$ret.="$choice ($percent%) ";
}