From 7b1a98291b68255a7cb929534b13b07f521399a9 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Tue, 17 Dec 2019 01:58:27 -0500 Subject: [PATCH] don't try to render a name if the deleter is nil --- lib/philomena_web/templates/comment/_comment.html.slime | 2 +- lib/philomena_web/templates/post/_post.html.slime | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/templates/comment/_comment.html.slime b/lib/philomena_web/templates/comment/_comment.html.slime index dbfd04e0..4c1bc5f8 100644 --- a/lib/philomena_web/templates/comment/_comment.html.slime +++ b/lib/philomena_web/templates/comment/_comment.html.slime @@ -11,7 +11,7 @@ article.block.communication id="comment_#{@comment.id}" strong.comment_deleted ' Deletion reason: =<> @comment.deletion_reason - = if can?(@conn, :hide, @comment) do + = if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do | ( = @comment.deleted_by.name | ) diff --git a/lib/philomena_web/templates/post/_post.html.slime b/lib/philomena_web/templates/post/_post.html.slime index ba2aa79a..be025f6d 100644 --- a/lib/philomena_web/templates/post/_post.html.slime +++ b/lib/philomena_web/templates/post/_post.html.slime @@ -11,7 +11,7 @@ article.block.communication id="post_#{@post.id}" strong.comment_deleted ' Deletion reason: => @post.deletion_reason - = if can?(@conn, :hide, @post) do + = if can?(@conn, :hide, @post) and not is_nil(@post.deleted_by) do | ( = @post.deleted_by.name | )