Skip to content

Commit

Permalink
fix(MessagePayload): prevent spread of undefined (discordjs#7029)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet authored and Jiralite committed Dec 1, 2021
1 parent d2f656a commit d7b15e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/MessagePayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class MessagePayload {
description: file.description,
}));
if (Array.isArray(this.options.attachments)) {
this.options.attachments.push(...attachments);
this.options.attachments.push(...(attachments ?? []));
} else {
this.options.attachments = attachments;
}
Expand Down

0 comments on commit d7b15e7

Please sign in to comment.