summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-26 17:55:34 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-26 18:02:37 +0200
commit431bf2f2f3ee973a89ee61a046893e6b3a96585c (patch)
treebc66cdf7cd18cf63bd2658c781035da6f789ddd8
parenta4a170e58e0d795098567e1aea431e49b6956de3 (diff)
tu_details.php: Avoid division by zero
Do not divide by zero if the number of active TUs is unknown. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/template/tu_details.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/template/tu_details.php b/web/template/tu_details.php
index c09e30c..c546eb7 100644
--- a/web/template/tu_details.php
+++ b/web/template/tu_details.php
@@ -6,7 +6,11 @@ $active_tus = $row["ActiveTUs"];
$quorum = $row["Quorum"];
$total = $yes + $no + $abstain;
-$participation = $total / $active_tus;
+if ($active_tus > 0) {
+ $participation = $total / $active_tus;
+} else {
+ $participation = 0;
+}
if ($yes > $active_tus / 2) {
$vote_accepted = true;