BUGFIX: elo could be null

This commit is contained in:
Jeroen De Meerleer 2023-01-09 12:51:23 +01:00
parent 6c7249bd3e
commit e113d743ca
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 3 additions and 3 deletions

View File

@ -301,9 +301,9 @@ class Player
* *
* @return int * @return int
*/ */
public function getElo(string $type): int public function getElo(string $type): ?int
{ {
return $this->Elos[ $type ]; return isset($this->Elos[ $type ]) ? $this->Elos[ $type ] : null;
} }
/** /**

View File

@ -728,7 +728,7 @@ class Tournament
$tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2; $tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2;
} }
} }
if ($pairing->Result === Result::WON_BYE) { if ($pairing->Result == Result::WON_BYE) {
$tiebreak += $player->calculatePointsForVirtualPlayer($key); $tiebreak += $player->calculatePointsForVirtualPlayer($key);
} }
} }