diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 3a993eb1f..e2c105046 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -1044,7 +1044,7 @@ export const ProblemApi = { async (ctx, args) => { const pdocs = await problem.getList(args.domainId, args.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id, undefined, undefined, true); - return Object.keys(pdocs).map((id) => pdocs[+id]); + return args.ids.map((id) => pdocs[+id]).filter((i) => i); }, ), } as const;