From a3030112374fef8c2e0712199dfe9894491fea69 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 9 Dec 2019 12:34:48 -0500 Subject: [PATCH] fix(mail(js)): avoid exception when adding duplicated recipient --- UI/WebServerResources/js/Mailer/MessageEditorController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Mailer/MessageEditorController.js b/UI/WebServerResources/js/Mailer/MessageEditorController.js index 9764cc438..f6fa6330a 100644 --- a/UI/WebServerResources/js/Mailer/MessageEditorController.js +++ b/UI/WebServerResources/js/Mailer/MessageEditorController.js @@ -355,7 +355,9 @@ i = recipients.indexOf(contact); recipients.splice(i, 1); for (j = 0; j < contact.members.length; j++) { - recipients.splice(i + j, 0, contact.members[j].$shortFormat()); + var recipient = contact.members[j].$shortFormat(); + if (recipients.indexOf(recipient) < 0) + recipients.splice(i + j, 0, contact.members[j].$shortFormat()); } };