From d0820c81ce3ceb68478c17841880b22cc6fccd82 Mon Sep 17 00:00:00 2001 From: omuretsu <84951833+Snarling@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:37:25 -0400 Subject: [PATCH] Recover from null moneyTracker There shouldn't be any way to get null, but it was reported to occur and this will recover when this happens. --- src/utils/MoneySourceTracker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/MoneySourceTracker.ts b/src/utils/MoneySourceTracker.ts index df03bedb6..28219e79a 100644 --- a/src/utils/MoneySourceTracker.ts +++ b/src/utils/MoneySourceTracker.ts @@ -31,7 +31,7 @@ export class MoneySourceTracker { // Record money earned record(amt: number, source: string): void { const sanitizedSource = source.toLowerCase(); - if (typeof this[sanitizedSource] !== "number") { + if (typeof this[sanitizedSource] !== "number" && this[sanitizedSource] !== null) { console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`); return; }