From d3a84fe411c991c3fd689296bd51a1c43d5da58d Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 9 Sep 2020 16:41:41 -0600 Subject: [PATCH] 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. --- tildes/tildes/templates/topic.jinja2 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tildes/tildes/templates/topic.jinja2 b/tildes/tildes/templates/topic.jinja2 index 4a06858..dc678a6 100644 --- a/tildes/tildes/templates/topic.jinja2 +++ b/tildes/tildes/templates/topic.jinja2 @@ -323,12 +323,14 @@ ({{ pluralize(comments.num_top_level, "thread") }}) -
Last comment posted
-
- - {{ adaptive_date_responsive(comments.most_recent_comment.created_time) }} - -
+ {% if comments.most_recent_comment %} +
Last comment posted
+
+ + {{ adaptive_date_responsive(comments.most_recent_comment.created_time) }} + +
+ {% endif %} {% else %}
No comments yet
{% endif %}