From ce9a4507b3e3fc0f1d58bf79a69bc2affa04ac98 Mon Sep 17 00:00:00 2001 From: "Zaid \"Nico" Date: Sun, 8 Aug 2021 23:42:42 -0400 Subject: [PATCH 1/2] fix: remove truthy check before isNaN check --- 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 1865d6b889ce..00ab8adbeab3 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 (isNaN(color)) throw new TypeError('COLOR_CONVERT'); return color; } From d22cc10fda3207a2c0e38dd4d278e81b2641dbf1 Mon Sep 17 00:00:00 2001 From: Nico Date: Mon, 9 Aug 2021 15:53:36 -0400 Subject: [PATCH 2/2] Update src/util/Util.js 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 00ab8adbeab3..930c19490b35 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 (isNaN(color)) throw new TypeError('COLOR_CONVERT'); + else if (Number.isNaN(color)) throw new TypeError('COLOR_CONVERT'); return color; }