diff --git a/backend/src/data/GuildCounters.ts b/backend/src/data/GuildCounters.ts index 52f20293..a87861b1 100644 --- a/backend/src/data/GuildCounters.ts +++ b/backend/src/data/GuildCounters.ts @@ -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; } diff --git a/backend/src/plugins/Counters/CountersPlugin.ts b/backend/src/plugins/Counters/CountersPlugin.ts index 6d4bf708..adec8b84 100644 --- a/backend/src/plugins/Counters/CountersPlugin.ts +++ b/backend/src/plugins/Counters/CountersPlugin.ts @@ -203,6 +203,10 @@ export const CountersPlugin = zeppelinGuildPlugin()({ const decay = counter.decay; const decayPeriodMs = convertDelayStringToMS(decay.every)!; + if (decayPeriodMs === 0) { + continue; + } + pluginData.state.decayTimers.push( setInterval(() => { decayCounter(pluginData, counterName, decayPeriodMs, decay.amount);