From 431bf2f2f3ee973a89ee61a046893e6b3a96585c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 26 Aug 2013 17:55:34 +0200 Subject: 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 --- web/template/tu_details.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web/template/tu_details.php') 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; -- cgit v1.2.3-70-g09d2