mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Fix deleting posts/discussions by deleted user (#2521)
Making the $user argument nullable prevents this unnecessary exception, and doesn't introduce any issues since we check that $user exists as part of the method.
This commit is contained in:
parent
d4b2d89da0
commit
aae83c4fbc
|
@ -65,7 +65,7 @@ class UserMetadataUpdater
|
|||
/**
|
||||
* @param \Flarum\User\User $user
|
||||
*/
|
||||
private function updateCommentsCount(User $user)
|
||||
private function updateCommentsCount(?User $user)
|
||||
{
|
||||
if ($user && $user->exists) {
|
||||
$user->refreshCommentCount()->save();
|
||||
|
|
Loading…
Reference in New Issue
Block a user