From 3c17939fd53a1f139d95bd36dfdab85b46538a73 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 10 Aug 2021 16:14:41 -0400 Subject: [PATCH] fix(Util): remove truthy check before isNaN check (#6358) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Román --- src/util/Util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/Util.js b/src/util/Util.js index 1865d6b88..930c19490 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -470,7 +470,7 @@ class Util extends null { } if (color < 0 || color > 0xffffff) throw new RangeError('COLOR_RANGE'); - else if (color && isNaN(color)) throw new TypeError('COLOR_CONVERT'); + else if (Number.isNaN(color)) throw new TypeError('COLOR_CONVERT'); return color; }