From 8312b79984f7224396394d649851a751a15a09e5 Mon Sep 17 00:00:00 2001
From: Matthew Slater <matslats@fastmail.com>
Date: Tue, 30 Aug 2022 11:50:58 +0200
Subject: [PATCH] fixed a bug assuming that a user object was being passed to
 the user_name_alter hook.

---
 alt_login.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/alt_login.module b/alt_login.module
index 6cf0100..42a9149 100644
--- a/alt_login.module
+++ b/alt_login.module
@@ -26,7 +26,7 @@ function alt_login_help($route_name, $route_match) {
  * @note there's no easy way to dedupe accounts' display names.
  */
 function alt_login_user_format_name_alter(&$name, AccountInterface $account) {
-  if ($account->isAnonymous() and !$account->isNew()) { // includes accounts tha
+  if ($account->isAnonymous() or ($account instanceof UserInterface and $account->isNew())) {
     // This will be the configured 'anonymous' value
     return;
   }
-- 
GitLab