mirror of
https://github.com/flarum/framework.git
synced 2025-04-26 06:34:06 +08:00
Fix crash when post's user has been deleted
This commit is contained in:
parent
f8d065bd78
commit
1a239ee93a
@ -8,7 +8,7 @@ $postsCount = count($discussion->relationships->posts->data);
|
|||||||
<div>
|
<div>
|
||||||
@foreach ($posts as $post)
|
@foreach ($posts as $post)
|
||||||
<div>
|
<div>
|
||||||
<?php $user = $getResource($post->relationships->user->data); ?>
|
<?php $user = ! empty($post->relationships->user->data) ? $getResource($post->relationships->user->data) : null; ?>
|
||||||
<h3>{{ $user ? $user->attributes->username : $translator->trans('core.lib.username.deleted_text') }}</h3>
|
<h3>{{ $user ? $user->attributes->username : $translator->trans('core.lib.username.deleted_text') }}</h3>
|
||||||
<div class="Post-body">
|
<div class="Post-body">
|
||||||
{!! $post->attributes->contentHtml !!}
|
{!! $post->attributes->contentHtml !!}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user