From 54cfba56dc6c77d85edb467d99dd219e0b0deda9 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 17 May 2016 09:35:30 +1000 Subject: [PATCH] FIX: handle missing user for posts --- app/views/list/list.rss.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/list/list.rss.erb b/app/views/list/list.rss.erb index 7cc954ec2a0..78193a8f0d7 100644 --- a/app/views/list/list.rss.erb +++ b/app/views/list/list.rss.erb @@ -12,12 +12,16 @@ <% @topic_list.topics.each do |topic| %> <% topic_url = topic.url -%> + <% username = topic.user ? topic.user.username : "" %> + <% name = topic.user ? topic.user.name : "" %> <%= topic.title %> - ]]> + ]]> <%= topic.category.name %> <%= t('author_wrote', author: link_to("@#{topic.user.username}", "#{Discourse.base_url}/users/#{topic.user.username_lower}")).html_safe %>

+ <% if username.present? %> +

<%= t('author_wrote', author: link_to("@#{username}", "#{Discourse.base_url}/users/#{topic.user.username_lower}")).html_safe %>

+ <% end %>
<%= topic.posts.first.cooked.html_safe %>