diff --git a/src/Model/User.php b/src/Model/User.php index f81b1ce76..14f40662b 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -1505,6 +1505,10 @@ class User */ public static function identities($uid) { + if (empty($uid)) { + return []; + } + $identities = []; $user = DBA::selectFirst('user', ['uid', 'nickname', 'username', 'parent-uid'], ['uid' => $uid]); diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php index 430ede13b..ce101477e 100644 --- a/src/Security/Authentication.php +++ b/src/Security/Authentication.php @@ -342,8 +342,10 @@ class Authentication $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $user_record['uid']]); // Set the login date for all identities of the user - $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], - ['parent-uid' => $masterUid, 'account_removed' => false]); + if (!empty($masterUid)) { + $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], + ['parent-uid' => $masterUid, 'account_removed' => false]); + } } if ($login_initial) {