fix: null check

This commit is contained in:
TrèsAbhi committed 2024-07-08 12:46:56 -05:00
1 parent d34bc4db06
commit eb87463f08
1 file changed
+3 -1
+3 -1
View File
@@ -73,6 +73,9 @@ times(THREADS, async () => {
const filteredIds = ids.filter((_, index) => {
const info = accountInfo[index];
if (info === null) return false;
const timeSinceLastActivity = Date.now() - info.last_battle_time * 1000;
samples.total++;
@@ -84,7 +87,6 @@ times(THREADS, async () => {
if (timeSinceLastActivity <= 1 * DAY) samples.d_1++;
return (
info !== null &&
timeSinceLastActivity <= MAX_ACTIVITY_TIME &&
info.statistics.all.battles > MIN_BATTLES
);