]> git.mxchange.org Git - friendica.git/blobdiff - src/Security/Authentication.php
An empty user id does not have children
[friendica.git] / src / Security / Authentication.php
index 61553907fa9ff9b349aa59949eb68af0312033ac..ce101477e0a2ee043764ea18b70ac98c8d0ad970 100644 (file)
@@ -39,6 +39,7 @@ use Friendica\Util\Network;
 use Friendica\Util\Strings;
 use LightOpenID;
 use Friendica\Core\L10n;
+use Friendica\Core\Logger;
 use Psr\Log\LoggerInterface;
 
 /**
@@ -341,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) {