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>
This commit is contained in:
Lukas Fleischer 2013-08-26 17:55:34 +02:00
parent a4a170e58e
commit 431bf2f2f3

View file

@ -6,7 +6,11 @@ $active_tus = $row["ActiveTUs"];
$quorum = $row["Quorum"]; $quorum = $row["Quorum"];
$total = $yes + $no + $abstain; $total = $yes + $no + $abstain;
$participation = $total / $active_tus; if ($active_tus > 0) {
$participation = $total / $active_tus;
} else {
$participation = 0;
}
if ($yes > $active_tus / 2) { if ($yes > $active_tus / 2) {
$vote_accepted = true; $vote_accepted = true;