Merge pull request #5709 from nextcloud/null-user-exist

null users dont exist
This commit is contained in:
Joas Schilling 2017-07-18 18:24:42 +02:00 committed by GitHub
commit e71b9fb3d6
1 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,9 @@ class Manager extends PublicEmitter implements IUserManager {
* @return \OC\User\User|null Either the user or null if the specified user does not exist * @return \OC\User\User|null Either the user or null if the specified user does not exist
*/ */
public function get($uid) { public function get($uid) {
if (is_null($uid) || $uid === '' || $uid === false) {
return null;
}
if (isset($this->cachedUsers[$uid])) { //check the cache first to prevent having to loop over the backends if (isset($this->cachedUsers[$uid])) { //check the cache first to prevent having to loop over the backends
return $this->cachedUsers[$uid]; return $this->cachedUsers[$uid];
} }