Skip to content

Commit 43cf7fb

Browse files
authored
Merge pull request #161 from JacobLinCool/codex/investigate-and-fix-typeerror-in-leetcode-worker
Handle null contest history
2 parents 257c091 + 714d5ab commit 43cf7fb

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)