diff --git a/includes/Hooks.php b/includes/Hooks.php index c4a56f671..011a0d0e0 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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(); } ); }