You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/11/10 11:52:15 UTC

incubator-ponymail git commit: Hack to deal with null json.body entries

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 48a459955 -> 9677273ba


Hack to deal with null json.body entries

Eventually these need to be dealt with at source.
But it does no harm to handle these here as a longstop

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/9677273b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/9677273b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/9677273b

Branch: refs/heads/master
Commit: 9677273baa350530890b2f1a7db569a62cec214a
Parents: 48a4599
Author: Sebb <se...@apache.org>
Authored: Thu Nov 10 11:51:58 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Thu Nov 10 11:51:58 2016 +0000

----------------------------------------------------------------------
 site/js/dev/ponymail_email_displays.js | 2 ++
 site/js/ponymail.js                    | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9677273b/site/js/dev/ponymail_email_displays.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
index 1ea580e..8d83f5d 100644
--- a/site/js/dev/ponymail_email_displays.js
+++ b/site/js/dev/ponymail_email_displays.js
@@ -76,6 +76,7 @@ function displayEmail(json, id, level) {
         
         // Escape email body, convert < to &lt;
         var ebody = json.body
+        if (ebody == null) {ebody = '(null body)'} // temporary hack to deal with broken bodies
         ebody = ebody.replace(/</mg, "&lt;")
         ebody = "\n" + ebody // add a newline at top
         var base = pm_config.URLBase ? pm_config.URLBase : ""
@@ -261,6 +262,7 @@ function displaySingleEmail(json, id) {
         var lid = json.list.replace(/[<>]/g, "").replace(/^([^.]+)\./, "$1@")
 
         var ebody = json.body
+        if (ebody == null) {ebody = '(null body)'} // temporary hack to deal with broken bodies
         ebody = ebody.replace(/</, "&lt;")
         ebody = "\n" + ebody
         var base = pm_config.URLBase ? pm_config.URLBase : ""

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9677273b/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index ec72853..909bc10 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -1430,6 +1430,7 @@ function displayEmail(json, id, level) {
         
         // Escape email body, convert < to &lt;
         var ebody = json.body
+        if (ebody == null) {ebody = '(null body)'} // temporary hack to deal with broken bodies
         ebody = ebody.replace(/</mg, "&lt;")
         ebody = "\n" + ebody // add a newline at top
         var base = pm_config.URLBase ? pm_config.URLBase : ""
@@ -1615,6 +1616,7 @@ function displaySingleEmail(json, id) {
         var lid = json.list.replace(/[<>]/g, "").replace(/^([^.]+)\./, "$1@")
 
         var ebody = json.body
+        if (ebody == null) {ebody = '(null body)'} // temporary hack to deal with broken bodies
         ebody = ebody.replace(/</, "&lt;")
         ebody = "\n" + ebody
         var base = pm_config.URLBase ? pm_config.URLBase : ""