diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-07-25 17:52:50 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-07-25 17:52:50 +0200 |
commit | bf12bba07966cd8d106167807c272e8df38bbd0e (patch) | |
tree | b7e0abab6c9888ec6b7687ecd76c34889e937525 | |
parent | 40f2a34be113db75cd26166de35e9ba3076e4cf3 (diff) | |
download | nextcloud-server-bf12bba07966cd8d106167807c272e8df38bbd0e.tar.gz nextcloud-server-bf12bba07966cd8d106167807c272e8df38bbd0e.zip |
Dont throw an error when calling $server->getUserFolder when logged out
-rw-r--r-- | lib/private/server.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 6bd0eabb6e3..3b07f5711e7 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -255,7 +255,11 @@ class Server extends SimpleContainer implements IServerContainer { * @return \OCP\Files\Folder */ function getUserFolder() { - $dir = '/' . $this->getUserSession()->getUser()->getUID(); + $user = $this->getUserSession()->getUser(); + if (!$user) { + return null; + } + $dir = '/' . $user->getUID(); $root = $this->getRootFolder(); $folder = null; |