Skip to content

Commit 714d5ab

Browse files
committed
fix(contest): handle null history
1 parent 9228e8e commit 714d5ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/exts/contest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export async function ContestExtension(generator: Generator): Promise<Extension>
1010
lc.user_contest_info(generator.config.username)
1111
.then((data) => {
1212
try {
13-
const history = data.userContestRankingHistory.filter((x) => x.attended);
13+
const history = Array.isArray(data.userContestRankingHistory)
14+
? data.userContestRankingHistory.filter((x) => x.attended)
15+
: [];
1416

1517
if (history.length === 0) {
1618
resolve(null);

0 commit comments

Comments
 (0)