From 87ec3fbf1d2c3efc7427c0e178ffb09ae2aacaac Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 25 Jul 2014 17:52:50 +0200 Subject: [PATCH] Dont throw an error when calling $server->getUserFolder when logged out Conflicts: lib/private/server.php --- lib/private/server.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/server.php b/lib/private/server.php index da705863078..3299792e20d 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 = '/' . \OCP\User::getUser(); + $user = $this->getUserSession()->getUser(); + if (!$user) { + return null; + } + $dir = '/' . $user->getUID(); $root = $this->getRootFolder(); $folder = null; -- 2.39.5