mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix reference handle
This commit is contained in:
1 parent
4aa689b508
commit
628ec7953b
3 files changed
+3
-3
No files matched your search
@@ -490,7 +490,7 @@ export class ProblemFileDownloadHandler extends ProblemDetailHandler {
|
||||
if (this.pdoc.reference) {
|
||||
if (type === 'testdata') throw new ForbiddenError('Cannot download testdata');
|
||||
this.pdoc = await problem.get(this.pdoc.reference.domainId, this.pdoc.reference.pid);
|
||||
if (!this.pdoc) throw new ProblemNotFoundError(this.pdoc.reference.domainId, this.pdoc.reference.pid);
|
||||
if (!this.pdoc) throw new ProblemNotFoundError();
|
||||
}
|
||||
if (type === 'testdata' && !this.user.own(this.pdoc)) {
|
||||
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
|
||||
Reference in new issue
Block a user