aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/utils.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/utils.rb b/lib/utils.rb
index cc9fd46..e3a4836 100644
--- a/lib/utils.rb
+++ b/lib/utils.rb
@@ -61,7 +61,10 @@ module Ag
def get_sender_displayname(message)
begin
- fix_encoding(message[:from].addrs.first.display_name).strip
+ display_name = message[:from].addrs.first.display_name
+ display_name ||= message[:from].addrs.first.to_s
+
+ fix_encoding(display_name).strip
rescue NoMethodError
fix_encoding(message[:from].to_s).strip
end