From fabd34381ce14a399204b0bf8fd1dde4bcb8628e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Rom=C3=A1n?= Date: Mon, 29 Nov 2021 11:18:41 +0100 Subject: [PATCH] fix(MessagePayload): prevent spread of `undefined` (#7029) --- src/structures/MessagePayload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/MessagePayload.js b/src/structures/MessagePayload.js index ba12b16113c1..8b309ba52820 100644 --- a/src/structures/MessagePayload.js +++ b/src/structures/MessagePayload.js @@ -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; }