summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-07-25 17:52:50 +0200
committerRobin Appelman <icewind@owncloud.com>2014-07-25 17:52:50 +0200
commitbf12bba07966cd8d106167807c272e8df38bbd0e (patch)
treeb7e0abab6c9888ec6b7687ecd76c34889e937525
parent40f2a34be113db75cd26166de35e9ba3076e4cf3 (diff)
downloadnextcloud-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.php6
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;