Skip to content

Commit

Permalink
fix random notice when autocreating users (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak authored Nov 27, 2022
1 parent cbdff8f commit 1992e3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ public function update_user_record_from_attribute_map(&$user, $attributes, $newu
// If can't have accounts with the same emails, check if email is taken before update a new user.
if ($field == 'email' && empty($CFG->allowaccountssameemail)) {
$email = $attributes[$attr][0];
if ($this->is_email_taken($email, $user->username)) {
if ($this->is_email_taken($email, $user->username ?? null)) {
$this->log(__FUNCTION__ .
" user '$user->username' email can't be updated as '$email' is taken");
// Warn user that we are not able to update his email.
Expand Down

0 comments on commit 1992e3d

Please sign in to comment.