Skip to content

Commit 6411166

Browse files
committed
Protect function against nonexistent contest
1 parent 0557de6 commit 6411166

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webapp/src/Service/ScoreboardService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,11 @@ protected function getCategories(bool $jury): array
10781078
* Get the scorecache used to calculate the scoreboard.
10791079
* @return ScoreCache[]
10801080
*/
1081-
protected function getScorecache(Contest $contest, ?Team $team = null): array
1081+
protected function getScorecache(?Contest $contest, ?Team $team = null): array
10821082
{
1083+
if (!$contest) {
1084+
return [];
1085+
}
10831086
$queryBuilder = $this->em->createQueryBuilder()
10841087
->from(ScoreCache::class, 's')
10851088
->select('s')

0 commit comments

Comments
 (0)