From 694d14d43a9c50f7287a592cb1db2e0db783e97c Mon Sep 17 00:00:00 2001 From: Usoka <27248545+Usoka@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:59:11 +1200 Subject: [PATCH] BugFix Correct NaN check in setcounter Use isNaN check so 0 can be accepted but still restrict to only numbers --- backend/src/plugins/Counters/commands/SetCounterCmd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Counters/commands/SetCounterCmd.ts b/backend/src/plugins/Counters/commands/SetCounterCmd.ts index edabe2e7..a15552fb 100644 --- a/backend/src/plugins/Counters/commands/SetCounterCmd.ts +++ b/backend/src/plugins/Counters/commands/SetCounterCmd.ts @@ -111,7 +111,7 @@ export const SetCounterCmd = guildCommand()({ } const potentialValue = parseInt(reply.content, 10); - if (!potentialValue) { + if (isNaN(potentialValue)) { sendErrorMessage(pluginData, message.channel, "Not a number, cancelling"); return; }