Skip to content

Commit

Permalink
Allow empty current contest (use null instead of -1)
Browse files Browse the repository at this point in the history
  • Loading branch information
zapotocnylubos committed Aug 2, 2024
1 parent 5b67b43 commit 47103b4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions webapp/src/EventSubscriber/ContestIdSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ public function onKernelRequest(RequestEvent $event): void
return;
}

$teamId = $this->dj->getUser() ? $this->dj->getUser()->getTeamId() : -1;
$teamId = $this->dj->getUser()?->getTeamId();
$currentContest = $this->dj->getCurrentContest($teamId);

if (!$currentContest) {
return;
}

if (!$cid = (int)$request->query->get('cid')) {
// "No cid found. Setting cid to current contest."
$response = new RedirectResponse(
Expand Down

0 comments on commit 47103b4

Please sign in to comment.