null users dont exist

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-07-13 14:33:46 +02:00
parent 701a865db7
commit ce45f87699
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
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
*/
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
return $this->cachedUsers[$uid];
}