mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(MessageEmbed): prevent possible destructuring error
This commit is contained in:
@@ -411,7 +411,13 @@ class MessageEmbed {
|
||||
* @returns {EmbedField[]}
|
||||
*/
|
||||
static normalizeFields(...fields) {
|
||||
return fields.flat(2).map(({ name, value, inline }) => this.normalizeField(name, value, inline));
|
||||
return fields.flat(2).map(field =>
|
||||
this.normalizeField(
|
||||
field && field.name,
|
||||
field && field.value,
|
||||
field && typeof field.inline === 'boolean' ? field.inline : false,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user