core: ignore empty ids

This commit is contained in:
undefined committed 2021-05-21 17:38:39 +08:00
1 parent f3e25eccbe
commit bcd6ad5b3f
4 files changed
+9 -5

No files matched your search

+4
View File
@@ -629,6 +629,10 @@ export class ProblemPrefixListHandler extends Handler {
@param('prefix', Types.Name)
async get(domainId: string, prefix: string) {
this.response.body = await problem.getPrefixList(domainId, prefix);
if (!Number.isNaN(+prefix)) {
const pdoc = await problem.get(domainId, +prefix, undefined, ['domainId', 'docId', 'pid', 'title']);
if (pdoc) this.response.body.unshift(pdoc);
}
}
}