From 2a8ac70fca87ecb3c5b756c8aa90662fddb4101e Mon Sep 17 00:00:00 2001 From: zoeeer Date: Tue, 28 Jul 2020 11:03:49 +0800 Subject: [PATCH] fix: category articles page error when author account deleted --- app/views/articles/_list_table.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/articles/_list_table.html.erb b/app/views/articles/_list_table.html.erb index 9c09d52d..9bf030fe 100644 --- a/app/views/articles/_list_table.html.erb +++ b/app/views/articles/_list_table.html.erb @@ -50,12 +50,12 @@ <% rating = article.rating_average.to_i %><%= rating != 0 ? "#{rating} / 5" : "-" %> <% unless @author_id %> - - <%= link_to article.author.name, { :controller => 'articles', + + <%= article.author ? (link_to article.author.name, { :controller => 'articles', :action => 'authored', :author_id => article.author.id, - :project_id => @project} %> - + :project_id => @project}): l(:label_user_anonymous) %> + <% end %> <%= time_ago_in_words article.created_at %> ago