mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-25 15:57:41 +01:00
Fixed a Division by zero warning
This commit is contained in:
parent
50fe0b47ce
commit
27001faf95
@ -650,7 +650,11 @@ class Tournament
|
|||||||
}
|
}
|
||||||
sort($allratings);
|
sort($allratings);
|
||||||
$allratings = array_slice($allratings, $cut);
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user