mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
fix(MessageEmbed): prevent possible destructuring error
This commit is contained in:
parent
e4f567c65e
commit
bbe169deac
1 changed files with 7 additions and 1 deletions
|
|
@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue