This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new ad0b159  return empty if address var is null
ad0b159 is described below

commit ad0b1592c6160342be92342f3f69a87e4b66a4ea
Author: Daniel Gruno <[email protected]>
AuthorDate: Thu Nov 11 19:50:06 2021 +0100

    return empty if address var is null
---
 webui/js/ponymail.js            | 1 +
 webui/js/source/render-email.js | 1 +
 2 files changed, 2 insertions(+)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index ec7e8a1..26917fd 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -3459,6 +3459,7 @@ let full_emails = {};
 // Function for parsing email addresses from a to or cc line
 function get_rcpts(addresses) {
     let list_of_emails = []
+    if (!addresses) return [] // cc or to may be null
     for (let a of addresses.split(/,\s*/)) {
         let m = a.match(/<(.+)>/);
         if (m) {
diff --git a/webui/js/source/render-email.js b/webui/js/source/render-email.js
index 6d1b2ef..1627ed7 100644
--- a/webui/js/source/render-email.js
+++ b/webui/js/source/render-email.js
@@ -3,6 +3,7 @@ let full_emails = {};
 // Function for parsing email addresses from a to or cc line
 function get_rcpts(addresses) {
     let list_of_emails = []
+    if (!addresses) return [] // cc or to may be null
     for (let a of addresses.split(/,\s*/)) {
         let m = a.match(/<(.+)>/);
         if (m) {

Reply via email to