diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-19 12:43:58 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-19 12:43:58 +0100 |
| commit | 2f95cfb8ed2a2e4dda2aee4f1f6f003587f9005c (patch) | |
| tree | b788f0bcbc56b155e35f2af195f1dd0273c8da11 /addons/mail/static/src/js/utils.js | |
| parent | fdb585caf597b5a77d241087260ac42e3c3fb94e (diff) | |
| parent | f99c4f2b48b29f19a0d2ee1cd999008c92ab2a89 (diff) | |
[MERGE] forward port branch saas-16 up to f99c4f2b48b
Diffstat (limited to 'addons/mail/static/src/js/utils.js')
| -rw-r--r-- | addons/mail/static/src/js/utils.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 6364be77eb5..49d1705eccd 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -100,15 +100,17 @@ function inline (node, transform_children) { // Parses text to find email: Tagada <address@mail.fr> -> [Tagada, address@mail.fr] or False function parse_email (text) { - var result = text.match(/(.*)<(.*@.*)>/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[2])]; - } - result = text.match(/(.*@.*)/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[1])]; + if (text){ + var result = text.match(/(.*)<(.*@.*)>/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[2])]; + } + result = text.match(/(.*@.*)/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[1])]; + } + return [text, false]; } - return [text, false]; } // Replaces textarea text into html text (add <p>, <a>) |
