Skip to content

Commit

Permalink
Add nullcheck for problem of testcase in auditlog.
Browse files Browse the repository at this point in the history
Testcase.probid is nullable, so the problem doesn't have to exist.
  • Loading branch information
nickygerritsen committed Mar 27, 2024
1 parent 4684bb6 commit 990838b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/src/Controller/Jury/AuditLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private function generateDatatypeUrl(string $type, int|string|null $id): ?string
return $this->generateUrl('jury_user', ['userId' => $id]);
case 'testcase':
$testcase = $this->em->getRepository(Testcase::class)->find($id);
if ($testcase) {
if ($testcase && $testcase->getProblem()) {
return $this->generateUrl('jury_problem_testcases', ['probId' => $testcase->getProblem()->getProbid()]);
}
break;
Expand Down

0 comments on commit 990838b

Please sign in to comment.