From 1090e82c5bc9649483cc102a027f9ef25cb401b1 Mon Sep 17 00:00:00 2001 From: ArtOfCode- <hello@artofcode.co.uk> Date: Mon, 14 Dec 2020 02:10:34 +0000 Subject: [PATCH] Catch nil --- app/views/posts/_toc_entry.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/posts/_toc_entry.html.erb b/app/views/posts/_toc_entry.html.erb index 466a40895..f3617a9ef 100644 --- a/app/views/posts/_toc_entry.html.erb +++ b/app/views/posts/_toc_entry.html.erb @@ -14,6 +14,8 @@ … <% end %> </p> - <p class="has-font-size-small"><%= time_ago_in_words(answer.last_edited_at, locale: :en_abbrev) %> ago</p> + <p class="has-font-size-small"> + <%= time_ago_in_words(answer.last_edited_at || answer.created_at, locale: :en_abbrev) %> ago + </p> </div> <% end %> -- GitLab