Browse Source

Can also be null

If the user does not exist this returns null and can lead to nasty bugs since the IDE is not indicating this...
tags/v8.1.0alpha1
Lukas Reschke 9 years ago
parent
commit
38fec9b095
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      lib/private/user/manager.php
  2. 1
    1
      lib/public/iusermanager.php

+ 1
- 1
lib/private/user/manager.php View File

@@ -103,7 +103,7 @@ class Manager extends PublicEmitter implements IUserManager {
* get a user by user id
*
* @param string $uid
* @return \OC\User\User
* @return \OC\User\User|null Either the user or null if the specified user does not exist
*/
public function get($uid) {
if (isset($this->cachedUsers[$uid])) { //check the cache first to prevent having to loop over the backends

+ 1
- 1
lib/public/iusermanager.php View File

@@ -53,7 +53,7 @@ interface IUserManager {
* get a user by user id
*
* @param string $uid
* @return \OCP\IUser
* @return \OCP\IUser|null Either the user or null if the specified user does not exist
*/
public function get($uid);


Loading…
Cancel
Save