whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Allow for non-existent from address
Date Thu, 03 May 2018 14:30:40 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new cbd2b7c  Allow for non-existent from address
cbd2b7c is described below

commit cbd2b7c63494806e57fb13022b5ae7456c344abb
Author: Sebb <sebb@apache.org>
AuthorDate: Thu May 3 15:30:39 2018 +0100

    Allow for non-existent from address
---
 www/secretary/workbench/models/message.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/www/secretary/workbench/models/message.rb b/www/secretary/workbench/models/message.rb
index 695f4d7..aed4a41 100644
--- a/www/secretary/workbench/models/message.rb
+++ b/www/secretary/workbench/models/message.rb
@@ -328,11 +328,12 @@ class Message
     # parse cleaned up message
     mail = Mail.read_from_string(message)
 
-    # parse from address
+    # parse from address (if it exists)
+    from_value = mail[:from].value rescue ''
     begin
-      from = liberal_email_parser(mail[:from].value).display_name
+      from = liberal_email_parser(from_value).display_name
     rescue Exception
-      from = mail[:from].value.sub(/\s+<.*?>$/)
+      from = from_value.sub(/\s+<.*?>$/)
     end
 
     # determine who should be copied on any responses

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.

Mime
View raw message