Skip to content

Commit 01b754d

Browse files
committed
Handle situation without contest
1 parent 77928f7 commit 01b754d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,10 @@ public function checkIfSamplesZipForContest(Contest $contest): bool
895895
->setParameter('cid', $contest->getCid());
896896

897897
/** @var Contest $contest */
898-
$contest = $contestQuery->getQuery()->getSingleResult();
898+
$contest = $contestQuery->getQuery()->getOneOrNullResult();
899+
if (!$contest) {
900+
return false;
901+
}
899902

900903
if ($contest->getContestProblemsetType()) {
901904
return true;

0 commit comments

Comments
 (0)