From b1e5c77a5643b3d130c16b11d4b6402c33af085a Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 27 Nov 2022 12:57:38 +0800 Subject: [PATCH] core: fix contest attended check --- packages/hydrooj/src/handler/record.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/record.ts b/packages/hydrooj/src/handler/record.ts index e34d63b5..6a399224 100644 --- a/packages/hydrooj/src/handler/record.ts +++ b/packages/hydrooj/src/handler/record.ts @@ -170,7 +170,7 @@ class RecordDetailHandler extends ContestDetailBaseHandler { if (this.tdoc.allowViewCode && contest.isDone(this.tdoc)) { canViewCode ||= tsdoc?.attend; } - if (!tsdoc.attend && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN); + if (!tsdoc?.attend && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN); } else if (!problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN); if (!canViewCode) { rdoc.code = '';