From 2db26d87c444ba385850d63e8d27f3b759102cfe Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Sun, 14 Oct 2018 19:09:55 +0200 Subject: filter null values for UserManager::getByEmail Signed-off-by: Georg Ehrke --- lib/private/User/Manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 494a345be59..16a911b90ac 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -591,8 +591,12 @@ class Manager extends PublicEmitter implements IUserManager { public function getByEmail($email) { $userIds = $this->config->getUsersForUserValue('settings', 'email', $email); - return array_map(function($uid) { + $users = array_map(function($uid) { return $this->get($uid); }, $userIds); + + return array_values(array_filter($users, function($u) { + return ($u instanceof IUser); + })); } } -- cgit v1.2.3