diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb
index 04afc7056bc..061f90d16ea 100644
--- a/app/views/user_notifications/digest.html.erb
+++ b/app/views/user_notifications/digest.html.erb
@@ -129,9 +129,11 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- <%= t.user.try(:username) -%>
- <% if SiteSetting.enable_names? && t.user.try(:name).present? %>
- <%= t.user.name -%>
+ <% if t.user %>
+ <%= t.user.username -%>
+ <% if SiteSetting.enable_names? && t.user.name.present? && t.user.name.downcase != t.user.username.downcase %>
+ <%= t.user.name -%>
+ <% end %>
<% end %>
|
<%- if show_image_with_url(t.image_url) -%>
@@ -261,9 +263,11 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
- <%= post.user.try(:username) -%>
- <% if SiteSetting.enable_names? && post.user.try(:name) %>
- <%= post.user.name -%>
+ <% if post.user %>
+ <%= post.user.username -%>
+ <% if SiteSetting.enable_names? && post.user.name && post.user.name.downcase != post.user.username %>
+ <%= post.user.name -%>
+ <% end %>
<% end %>
|
|