Merge "Hooks: Check if user is still registered"

This commit is contained in:
jenkins-bot 2023-01-26 10:33:29 +00:00 committed by Gerrit Code Review
commit aabbc36d1e

View file

@ -1417,6 +1417,11 @@ class Hooks implements
// option changes. This covers both explicit changes in the preferences
// and changes made through the options API (since both call this hook).
DeferredUpdates::addCallableUpdate( static function () use ( $user ) {
if ( !$user->isRegistered() ) {
// It's possible the user account was deleted before the deferred
// update runs (T318081)
return;
}
MWEchoNotifUser::newFromUser( $user )->resetNotificationCount();
} );
}