fix: post mentions with deleted author not rendering (#3432)

This commit is contained in:
Sami Mazouz 2022-06-02 13:38:24 +01:00 committed by GitHub
parent df1bdd2ad8
commit 0a3f449f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,10 +125,13 @@ class ConfigureMentions
{
$post = CommentPost::find($tag->getAttribute('id'));
if ($post && $post->user) {
if ($post) {
$tag->setAttribute('discussionid', (int) $post->discussion_id);
$tag->setAttribute('number', (int) $post->number);
$tag->setAttribute('displayname', $post->user->display_name);
if ($post->user) {
$tag->setAttribute('displayname', $post->user->display_name);
}
return true;
}