Skip to content

Commit

Permalink
check if user exists before judge check
Browse files Browse the repository at this point in the history
  • Loading branch information
venix12 committed Dec 11, 2023
1 parent fa01f21 commit 28c60c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ContestsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function show($id)
abort(404);
}

$isJudge = $contest->judges->find($user->getKey()) !== null;
$isJudge = $user !== null && $contest->judges->find($user->getKey()) !== null;

if ($contest->isVotingStarted() && isset($contest->getExtraOptions()['children'])) {
$contestIds = $contest->getExtraOptions()['children'];
Expand Down

0 comments on commit 28c60c5

Please sign in to comment.