From c555992478a9b26454b39a026a90a4267cc000b2 Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 17 Nov 2024 12:37:49 +0800 Subject: [PATCH] core: fix #907 --- packages/hydrooj/src/model/contest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index 4dd94dcf4..bd77d7e67 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -223,7 +223,7 @@ const acm = buildContestRule({ return row; }, async scoreboard(config, _, tdoc, pdict, cursor) { - const rankedTsdocs = await db.ranked(cursor, (a, b) => a.score === b.score && a.time === b.time); + const rankedTsdocs = await db.ranked(cursor, (a, b) => (a.score || 0) === (b.score || 0) && (a.time || 0) === (b.time || 0)); const uids = rankedTsdocs.map(([, tsdoc]) => tsdoc.uid); const udict = await user.getListForRender(tdoc.domainId, uids, config.showDisplayName ? ['displayName'] : []); // Find first accept @@ -394,7 +394,7 @@ const oi = buildContestRule({ return row; }, async scoreboard(config, _, tdoc, pdict, cursor) { - const rankedTsdocs = await db.ranked(cursor, (a, b) => a.score === b.score); + const rankedTsdocs = await db.ranked(cursor, (a, b) => (a.score || 0) === (b.score || 0)); const uids = rankedTsdocs.map(([, tsdoc]) => tsdoc.uid); const udict = await user.getListForRender(tdoc.domainId, uids, config.showDisplayName ? ['displayName'] : []); const psdict = {};