Browse Source

Fix issue if "most recent comment" not found

Not sure exactly how this can happen, but I've seen a few errors caused
by this.
merge-requests/126/merge
Deimos 4 years ago
parent
commit
d3a84fe411
  1. 14
      tildes/tildes/templates/topic.jinja2

14
tildes/tildes/templates/topic.jinja2

@ -323,12 +323,14 @@
({{ pluralize(comments.num_top_level, "thread") }})
</dd>
<dt>Last comment posted</dt>
<dd>
<a href="{{ comments.most_recent_comment.permalink }}" data-js-hide-sidebar-no-preventdefault>
{{ adaptive_date_responsive(comments.most_recent_comment.created_time) }}
</a>
</dd>
{% if comments.most_recent_comment %}
<dt>Last comment posted</dt>
<dd>
<a href="{{ comments.most_recent_comment.permalink }}" data-js-hide-sidebar-no-preventdefault>
{{ adaptive_date_responsive(comments.most_recent_comment.created_time) }}
</a>
</dd>
{% endif %}
{% else %}
<dd>No comments yet</dd>
{% endif %}

Loading…
Cancel
Save