isNaN checks
All checks were successful
deploy / deploy (push) Successful in 29s

This commit is contained in:
Lee 2023-10-30 15:05:28 +00:00
parent a19cf7e448
commit 12000f7de8

@ -164,8 +164,14 @@ async function updateAverages() {
point.floatField("stars", average.stars);
}
if (average.mistakes) {
point.intField("badCuts", average.mistakes.badCuts);
point.intField("missed", average.mistakes.missed);
point.intField(
"badCuts",
isNaN(average.mistakes.badCuts) ? 0 : average.mistakes.badCuts
);
point.intField(
"missed",
isNaN(average.mistakes.missed) ? 0 : average.mistakes.missed
);
}
if (average.rank) {
point.intField("rank", average.rank);