diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 13455e0f8..122f68684 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -616,7 +616,7 @@ export class ProblemEditHandler extends ProblemManageHandler { newPid: string | number = '', hidden = false, tag: string[] = [], difficulty = 0, ) { if (typeof newPid !== 'string') newPid = `P${newPid}`; - if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new ProblemAlreadyExistError(pid); + if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new ProblemAlreadyExistError(newPid); const $update: Partial = { title, content, pid: newPid, hidden, tag: tag ?? [], difficulty, html: false, };