fix for nan points

This commit is contained in:
Erik 2023-02-22 21:34:01 +02:00
parent 98fad951fa
commit 2bf6bc8e9e
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -44,7 +44,10 @@ class UserWrapper {
);
if (find.length) {
for (const { points, expiration, id } of find) {
for (const { points: p, expiration, id } of find) {
let points = p;
// Imported cases may have false or null
if (typeof points !== 'number') points = 0;
if (expiration > 0) {
index.expirations.push({ points, expiration, id });
} else {