File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/content/pages/ranking Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -181,9 +181,9 @@ export const fetchUserRating = createAsyncThunk<
181181 res = await query ( { message : { type : 'get-user-ranking' , username } } )
182182 }
183183 const { start_time } = getState ( ) . contestInfos [ contestSlug ] . info ! . contest
184- const history = res . userContestRankingHistory . filter ( a => a . attended )
185184
186- let l = 0 ,
185+ const history = res . userContestRankingHistory ?. filter ( a => a . attended ) ?? [ ]
186+ let l = - 1 ,
187187 r = history . length - 1
188188 while ( l < r ) {
189189 const m = ( l + r + 1 ) >> 1
@@ -194,7 +194,7 @@ export const fetchUserRating = createAsyncThunk<
194194 }
195195 }
196196
197- return { oldRating : history [ l ] . rating ?? 1500 , acc : l + 1 }
197+ return { oldRating : history [ l ] ? .rating ?? 1500 , acc : l + 1 }
198198 }
199199)
200200
You can’t perform that action at this time.
0 commit comments