FIX: always take the first post in the RSS feed

FIX: always take the first post in the RSS fee

.posts.first may be the first post and may not, depending on luck

Also add protection for corrupt topics

diff --git a/app/views/list/list.rss.erb b/app/views/list/list.rss.erb
index 69799bc..8824eeb 100644
--- a/app/views/list/list.rss.erb
+++ b/app/views/list/list.rss.erb
@@ -23,7 +23,9 @@
             <p><%= t('author_wrote', author: link_to("@#{username}", "#{Discourse.base_url}/u/#{topic.user.username_lower}")).html_safe %></p>
             <% end %>
             <blockquote>
-              <%= topic.posts.first.cooked.html_safe %>
+              <%- if first_post = topic.ordered_posts.first %>
+              <%= first_post.cooked.html_safe %>
+              <%- end %>
             </blockquote>
             <p><%= t 'num_posts' %> <%= topic.posts_count %></p>
             <p><%= t 'num_participants' %> <%= topic.participant_count %></p>

GitHub sha: a0474a07

1 Like