Skip to content

Commit

Permalink
fix(Util): remove truthy check before isNaN check (#6358)
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
  • Loading branch information
Nico and kyranet committed Aug 10, 2021
1 parent 2a3e819 commit 3c17939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/Util.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3c17939

Please sign in to comment.