Merge pull request #5688 from discourse/fix-embed-comments-template-error

FIX: Make sure a post has replies before accessing the reply_id
This commit is contained in:
Neil Lalonde 2018-03-27 15:30:53 -04:00 committed by GitHub
commit c9216626d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@
</h3>
<%= get_html(post.cooked) %>
<%- if post.reply_count > 0 %>
<%- if post.reply_count > 0 && post.replies.exists? %>
<%- if post.reply_count == 1 %>
<%= link_to I18n.t('embed.replies', count: post.reply_count), post.full_url, 'data-link-to-post' => post.replies.first.id.to_s, :class => 'post-replies button' %>
<% else %>