From adfe95103e18b13f3e4f55ffdf6263872c9864b2 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 2 May 2024 05:31:46 -0300 Subject: [PATCH] !0 evaluates as true, returning early for a case we didn't expect The if guard in this commit is aimed at catching null / undefined. --- src/js/components/Timer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/components/Timer.tsx b/src/js/components/Timer.tsx index 15789c0fd..32f6e9e3a 100644 --- a/src/js/components/Timer.tsx +++ b/src/js/components/Timer.tsx @@ -32,7 +32,7 @@ export function Timer({ }, [ayah?.id]); useEffect(() => { - if (!ayah || !ms) { + if (!ayah || typeof ms !== "number") { return; } else if (isStalled || isPaused) { /* no-op */