mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 02:49:29 +08:00
Make sure a post has replies before accessing the reply id
This commit is contained in:
parent
70c41e067b
commit
f213dea529
|
@ -27,7 +27,7 @@
|
||||||
</h3>
|
</h3>
|
||||||
<%= get_html(post.cooked) %>
|
<%= get_html(post.cooked) %>
|
||||||
|
|
||||||
<%- if post.reply_count > 0 %>
|
<%- if post.reply_count > 0 && post.replies.exists? %>
|
||||||
<%- if post.reply_count == 1 %>
|
<%- 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' %>
|
<%= 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 %>
|
<% else %>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user