mirror of
https://github.com/flarum/framework.git
synced 2025-03-10 04:05:30 +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
403ee77c6c
commit
a1a2598c03
@ -65,7 +65,7 @@ class UserMetadataUpdater
|
|||||||
/**
|
/**
|
||||||
* @param \Flarum\User\User $user
|
* @param \Flarum\User\User $user
|
||||||
*/
|
*/
|
||||||
private function updateCommentsCount(User $user)
|
private function updateCommentsCount(?User $user)
|
||||||
{
|
{
|
||||||
if ($user && $user->exists) {
|
if ($user && $user->exists) {
|
||||||
$user->refreshCommentCount()->save();
|
$user->refreshCommentCount()->save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user