From 53228984e822352deb7490a84faa12cf82cdcacf Mon Sep 17 00:00:00 2001 From: Melroy van den Berg Date: Fri, 13 Sep 2024 14:37:44 +0200 Subject: [PATCH] Check if EntryComment is defined and not null...?EntryComment can be null after all during the __invoke --- templates/entry/comment/view.html.twig | 28 +++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/templates/entry/comment/view.html.twig b/templates/entry/comment/view.html.twig index 5538e09e5..4423f570c 100644 --- a/templates/entry/comment/view.html.twig +++ b/templates/entry/comment/view.html.twig @@ -41,16 +41,20 @@ {% set autoAction = 'notifications:EntryCommentCreatedNotification@window->subject-list#addComment' %} {% set manualAction = 'notifications:EntryCommentCreatedNotification@window->subject-list#increaseCounter' %} -
- {{ component('entry_comment', { - comment: comment.root ?? comment, - showEntryTitle: false, - showMagazineName: false, - showNested: true, - }) }} -
+ + {% set entryComment = comment.root ?? comment %} + {% if entryComment is defined and entryComment is not null %} +
+ {{ component('entry_comment', { + comment: entryComment, + showEntryTitle: false, + showMagazineName: false, + showNested: true, + }) }} +
+ {% endif %} {% endblock %}