From b60ee25038907eb47b84729cc175e6ce7b505dc4 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Thu, 19 Apr 2018 13:14:20 +0200 Subject: [PATCH] fix(MessageEmbed): avoid throwing error when accessing colorless hexColor --- src/structures/MessageEmbed.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 85fdc2358..6bdb26982 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -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}`;