improve reuse in getUserFolder

This commit is contained in:
Robin Appelman 2016-02-19 14:27:55 +01:00
parent 5e6c905a14
commit 6031ae1ad4
1 changed files with 6 additions and 6 deletions

View File

@ -337,18 +337,18 @@ class Root extends Folder implements IRootFolder {
$dir = '/' . $userId; $dir = '/' . $userId;
$folder = null; $folder = null;
if (!$this->nodeExists($dir)) { try {
$folder = $this->newFolder($dir);
} else {
$folder = $this->get($dir); $folder = $this->get($dir);
} catch (NotFoundException $e) {
$folder = $this->newFolder($dir);
} }
$dir = '/files'; $dir = '/files';
if (!$folder->nodeExists($dir)) { try {
$folder = $folder->get($dir);
} catch (NotFoundException $e) {
$folder = $folder->newFolder($dir); $folder = $folder->newFolder($dir);
\OC_Util::copySkeleton($userId, $folder); \OC_Util::copySkeleton($userId, $folder);
} else {
$folder = $folder->get($dir);
} }
return $folder; return $folder;