From e113d743ca1001dc2244e525d08644a98785e663 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 9 Jan 2023 12:51:23 +0100 Subject: [PATCH] BUGFIX: elo could be null --- src/Player.php | 4 ++-- src/Tournament.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index 36efc25..8cf39ce 100644 --- a/src/Player.php +++ b/src/Player.php @@ -301,9 +301,9 @@ class Player * * @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; } /** diff --git a/src/Tournament.php b/src/Tournament.php index 125d9f0..a61217f 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -728,7 +728,7 @@ class Tournament $tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2; } } - if ($pairing->Result === Result::WON_BYE) { + if ($pairing->Result == Result::WON_BYE) { $tiebreak += $player->calculatePointsForVirtualPlayer($key); } }