filter null values for UserManager::getByEmail#11830
Conversation
c37157a to
9d6e5b5
Compare
Sounds related to this ticket: #7306 (no solution found though). |
lib/private/User/Manager.php
Outdated
| return array_map(function($uid) { | ||
| return $this->get($uid); | ||
| }, $userIds); | ||
| return array_reduce($userIds, function($carry, $uid) { |
There was a problem hiding this comment.
you can also just wrap the return of array_map with array_filter and it will remove those null values.
There was a problem hiding this comment.
I would also go for that code with array_filter because it's easier to read and understand.
There was a problem hiding this comment.
I went for array_reduce, so we only have to iterate once, not twice. But generally there should only be one (or a few users) anyway, so I change it to filter(map())
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
9d6e5b5 to
2db26d8
Compare
|
CI failure seems to be unrelated |
|
@georgehrke Mind to open the backport PR? |
I wasn't able to reproduce #9326, but it seems to be related to non-local user-backends. (Reporter is using ldap)
It seems that some user backends don't clean up
oc_preferencesproperly after a user was deleted in the backend. To be on the safe side we should filter null values.