summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-28 10:04:01 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-28 10:04:01 +0200
commitf2982b7a089780732bb2027ca9ba3362f1d01846 (patch)
tree7585b1b983f6c4bffd5fe4e03afc043072ecebd6 /lib/private/server.php
parent37f673c8b50f7768b204c642539ee880f6baa73d (diff)
parentbf12bba07966cd8d106167807c272e8df38bbd0e (diff)
downloadnextcloud-server-f2982b7a089780732bb2027ca9ba3362f1d01846.tar.gz
nextcloud-server-f2982b7a089780732bb2027ca9ba3362f1d01846.zip
Merge pull request #9904 from owncloud/loggedout-getuserfolder
Dont throw an error when calling $server->getUserFolder when logged out
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index 22f97429ef5..aab3c82bfeb 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -265,7 +265,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;