mirror of
https://github.com/flarum/framework.git
synced 2025-02-18 12:33:22 +08:00
Fix error when replying to a post by a deleted user
This commit is contained in:
parent
4d5a291d76
commit
49ed9c7dde
|
@ -10,7 +10,8 @@ export default function() {
|
|||
if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;
|
||||
|
||||
function insertMention(component, quote) {
|
||||
const mention = '@' + post.user().username() + '#' + post.id() + ' ';
|
||||
const user = post.user();
|
||||
const mention = '@' + (user ? user.username() : post.number()) + '#' + post.id() + ' ';
|
||||
|
||||
// If the composer is empty, then assume we're starting a new reply.
|
||||
// In which case we don't want the user to have to confirm if they
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
|
@ -129,7 +129,7 @@ class UpdatePostMentionsMetadata
|
|||
->whereIn('id', $mentioned)
|
||||
->get()
|
||||
->filter(function ($post) use ($reply) {
|
||||
return $post->user->id !== $reply->user->id;
|
||||
return $post->user && $post->user->id !== $reply->user_id;
|
||||
})
|
||||
->all();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user