diff --git a/src/structures/RichEmbed.js b/src/structures/RichEmbed.js index fe787bfaa..302734e66 100644 --- a/src/structures/RichEmbed.js +++ b/src/structures/RichEmbed.js @@ -150,9 +150,11 @@ class RichEmbed { if (this.fields.length >= 25) throw new RangeError('RichEmbeds may not exceed 25 fields.'); name = resolveString(name); if (name.length > 256) throw new RangeError('RichEmbed field names may not exceed 256 characters.'); + if (!/\S/.test(name)) throw new RangeError('RichEmbed field names may not be empty.'); value = resolveString(value); if (value.length > 1024) throw new RangeError('RichEmbed field values may not exceed 1024 characters.'); - this.fields.push({ name: String(name), value: value, inline }); + if (!/\S/.test(value)) throw new RangeError('RichEmbed field values may not be empty.'); + this.fields.push({ name, value, inline }); return this; }