mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
fix: null rating type safety
This commit is contained in:
1 parent
cb101da8a8
commit
d8feb5c3a8
1 file changed
+6
-6
@@ -134,7 +134,7 @@ for (const leaderboardChunk of chunk(leaderboard, 100)) {
|
|||||||
stats.forEach((stat, index) => {
|
stats.forEach((stat, index) => {
|
||||||
const trueIndex = chunkIndex * 100 + index;
|
const trueIndex = chunkIndex * 100 + index;
|
||||||
comprehensiveLeaderboard[trueIndex] =
|
comprehensiveLeaderboard[trueIndex] =
|
||||||
leaderboardChunk[index].id === 0
|
leaderboardChunk[index].id === 0 || stat.statistics.rating === undefined
|
||||||
? {
|
? {
|
||||||
battles: 0,
|
battles: 0,
|
||||||
damage: 0,
|
damage: 0,
|
||||||
@@ -147,11 +147,11 @@ for (const leaderboardChunk of chunk(leaderboard, 100)) {
|
|||||||
: {
|
: {
|
||||||
id: leaderboardChunk[index].id,
|
id: leaderboardChunk[index].id,
|
||||||
score: leaderboardChunk[index].score,
|
score: leaderboardChunk[index].score,
|
||||||
battles: stat.statistics.rating!.battles,
|
battles: stat.statistics.rating.battles,
|
||||||
damage: stat.statistics.rating!.damage_dealt,
|
damage: stat.statistics.rating.damage_dealt,
|
||||||
kills: stat.statistics.rating!.frags,
|
kills: stat.statistics.rating.frags,
|
||||||
survived: stat.statistics.rating!.survived_battles,
|
survived: stat.statistics.rating.survived_battles,
|
||||||
wins: stat.statistics.rating!.wins,
|
wins: stat.statistics.rating.wins,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user