Skip to content

Commit 990838b

Browse files
Add nullcheck for problem of testcase in auditlog.
Testcase.probid is nullable, so the problem doesn't have to exist.
1 parent 4684bb6 commit 990838b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webapp/src/Controller/Jury/AuditLogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function generateDatatypeUrl(string $type, int|string|null $id): ?string
156156
return $this->generateUrl('jury_user', ['userId' => $id]);
157157
case 'testcase':
158158
$testcase = $this->em->getRepository(Testcase::class)->find($id);
159-
if ($testcase) {
159+
if ($testcase && $testcase->getProblem()) {
160160
return $this->generateUrl('jury_problem_testcases', ['probId' => $testcase->getProblem()->getProbid()]);
161161
}
162162
break;

0 commit comments

Comments
 (0)