mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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:
parent
a4a170e58e
commit
431bf2f2f3
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue