Fixed a Division by zero warning

This commit is contained in:
Jeroen De Meerleer 2019-09-27 18:00:28 +02:00
parent 50fe0b47ce
commit 27001faf95
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 5 additions and 1 deletions

View File

@ -650,7 +650,11 @@ class Tournament
}
sort($allratings);
$allratings = array_slice($allratings, $cut);
return round(array_sum($allratings) / count($allratings));
$tiebreak = 0;
if (count($allratings) > 0) {
$tiebreak = round(array_sum($allratings) / count($allratings));
}
return $tiebreak;
}