mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Hooks: Check if user is still registered
In certain circumstances, it's possible for the user account to have been deleted by the time the deferred update runs. Bug: T318081 Change-Id: I3d1b5d1f034bf239e25d4af484b6329582b49bdc
This commit is contained in:
parent
6adf70e972
commit
77fce1c31b
|
@ -1415,6 +1415,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();
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue