]> source.dussan.org Git - nextcloud-server.git/commitdiff
caching of userfolder
authorRobin Appelman <robin@icewind.nl>
Thu, 24 Mar 2022 14:41:34 +0000 (15:41 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 24 Mar 2022 16:03:58 +0000 (17:03 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Node/Root.php

index 349a83848a5f0a8332f10a216c9c8d68a875e1f0..53162737b6fb847249611ea9f80beebdf11b65c6 100644 (file)
@@ -383,16 +383,14 @@ class Root extends Folder implements IRootFolder {
                        if ($this->mountManager->getSetupManager()->isSetupComplete($userObject)) {
                                try {
                                        $folder = $this->get('/' . $userId . '/files');
-                                       if ($folder instanceof \OCP\Files\Folder) {
-                                               return $folder;
-                                       } else {
+                                       if (!$folder instanceof \OCP\Files\Folder) {
                                                throw new \Exception("User folder for $userId exists as a file");
                                        }
                                } catch (NotFoundException $e) {
                                        if (!$this->nodeExists('/' . $userId)) {
                                                $this->newFolder('/' . $userId);
                                        }
-                                       return $this->newFolder('/' . $userId . '/files');
+                                       $folder = $this->newFolder('/' . $userId . '/files');
                                }
                        } else {
                                $folder = new LazyUserFolder($this, $userObject);