Skip to content

Commit 70eb696

Browse files
committed
Only get freezedata on existing contests
This is a annoying case, we only check if the contests exists after we know if the user has access. This prevents us from disclosing data but does require this null check.
1 parent 2f43d7b commit 70eb696

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webapp/src/Controller/API/ContestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public function problemsetAction(Request $request, string $cid): Response
364364

365365
$hasAccess = $this->dj->checkrole('jury') ||
366366
$this->dj->checkrole('api_reader') ||
367-
$contest->getFreezeData()->started();
367+
$contest?->getFreezeData()->started();
368368

369369
if (!$hasAccess) {
370370
throw new AccessDeniedHttpException();

0 commit comments

Comments
 (0)