fix(MessageEmbed): avoid throwing error when accessing colorless hexColor

This commit is contained in:
SpaceEEC
2018-04-19 13:14:20 +02:00
parent 3ba26ad972
commit b60ee25038

View File

@@ -113,10 +113,11 @@ class MessageEmbed {
/**
* The hexadecimal version of the embed color, with a leading hash
* @type {string}
* @type {?string}
* @readonly
*/
get hexColor() {
if (!this.color) return null;
let col = this.color.toString(16);
while (col.length < 6) col = `0${col}`;
return `#${col}`;