mirror of
https://github.com/flarum/core.git
synced 2025-07-27 03:30:28 +02: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:
committed by
GitHub
parent
d4b2d89da0
commit
aae83c4fbc
@@ -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();
|
||||||
|
Reference in New Issue
Block a user