diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-02-19 14:27:55 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-03-21 13:53:33 +0100 |
commit | 6031ae1ad41cb39ac8783b4a95f98574c28c92f1 (patch) | |
tree | 710f78faff281b2469f763ea03239cc051e0d5c8 | |
parent | 5e6c905a145d288127a08062a7a95e7577f5f4e2 (diff) | |
download | nextcloud-server-6031ae1ad41cb39ac8783b4a95f98574c28c92f1.tar.gz nextcloud-server-6031ae1ad41cb39ac8783b4a95f98574c28c92f1.zip |
improve reuse in getUserFolder
-rw-r--r-- | lib/private/files/node/root.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php index b5306eed8bb..69c98368dfd 100644 --- a/lib/private/files/node/root.php +++ b/lib/private/files/node/root.php @@ -337,18 +337,18 @@ class Root extends Folder implements IRootFolder { $dir = '/' . $userId; $folder = null; - if (!$this->nodeExists($dir)) { - $folder = $this->newFolder($dir); - } else { + try { $folder = $this->get($dir); + } catch (NotFoundException $e) { + $folder = $this->newFolder($dir); } $dir = '/files'; - if (!$folder->nodeExists($dir)) { + try { + $folder = $folder->get($dir); + } catch (NotFoundException $e) { $folder = $folder->newFolder($dir); \OC_Util::copySkeleton($userId, $folder); - } else { - $folder = $folder->get($dir); } return $folder; |