fix(MessagePayload): prevent spread of undefined (#7029)

This commit is contained in:
Antonio Román
2021-11-29 11:18:41 +01:00
committed by GitHub
parent 2c91c488e8
commit fabd34381c

View File

@@ -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;
}