diff --git a/includes/LoginNotify.php b/includes/LoginNotify.php index df8217a..306aa89 100644 --- a/includes/LoginNotify.php +++ b/includes/LoginNotify.php @@ -735,6 +735,16 @@ class LoginNotify implements LoggerAwareInterface { */ public function recordFailure( User $user ) { $this->incrStats( 'fail.total' ); + + if ( $user->isAnon() ) { + // Login failed because user doesn't exist + // skip this user. + $this->log->debug( "Skipping recording failure for {user} - no account", + [ 'user' => $user->getName() ] + ); + return; + } + $known = $this->isKnownSystemFast( $user, $user->getRequest() ); if ( $known === self::USER_KNOWN ) { $this->recordLoginFailureFromKnownSystem( $user );