diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index c8c4925fe..87d448944 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -7,7 +7,7 @@
- <%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">发布了通知:
@@ -275,7 +275,7 @@
- <%= link_to ma.course_message.user.show_name,
+ <%= link_to ma.course_message.user.try(:show_name),
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:
@@ -304,7 +304,7 @@
- <%=link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">发布了问卷:
@@ -327,7 +327,7 @@
- <%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %>
<% if ma.course_message.parent_id.nil? %>
@@ -423,7 +423,7 @@
- <%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">在班级中留言了:
@@ -447,7 +447,7 @@
- <%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">
<% if ma.course_message.m_parent_id.nil? %>
回复了您的作业:
diff --git a/app/views/users/_user_message_forge.html.erb b/app/views/users/_user_message_forge.html.erb
index 4a3d73ead..38d610aea 100644
--- a/app/views/users/_user_message_forge.html.erb
+++ b/app/views/users/_user_message_forge.html.erb
@@ -162,7 +162,7 @@
<% if ma.forge_message_type == "Message" %>
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %>
- - <%=link_to ma.forge_message.author.show_name, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+
- <%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
-
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@@ -181,7 +181,7 @@
-
- <%=link_to ma.forge_message.author.show_name, user_path(ma.forge_message.author),
+ <%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">评论了新闻: