3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

fix: fix crash when decay period is 0

This commit is contained in:
Dragory 2022-12-15 00:38:24 +02:00
parent ccd1d3d69e
commit 801cd2630b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 5 additions and 1 deletions

View file

@ -161,7 +161,7 @@ export class GuildCounters extends BaseGuildRepository {
}
const decayAmountToApply = Math.round((diffFromLastDecayMs / decayPeriodMs) * decayAmount);
if (decayAmountToApply === 0) {
if (decayAmountToApply === 0 || Number.isNaN(decayAmountToApply)) {
return;
}