Skip to content

Commit d2a38aa

Browse files
committed
Only limit on contestproblems when there is a current contest
1 parent e20e8ce commit d2a38aa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,13 @@ public function getUpdates(): array
427427
->leftJoin('s.problem', 'p')
428428
->leftJoin('s.contest', 'co')
429429
->leftJoin('s.team', 't')
430-
->andWhere('b.done = 0')
431-
->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
432-
->andWhere('co.cid = :cid')
433-
->setParameter('cid', $contest->getCid());
430+
->andWhere('b.done = 0');
431+
432+
if ($contest) {
433+
$balloonsQuery->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
434+
->andWhere('co.cid = :cid')
435+
->setParameter('cid', $contest->getCid());
436+
}
434437

435438
$freezetime = $contest->getFreezeTime();
436439
if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) {

0 commit comments

Comments
 (0)