improve reuse in getUserFolder

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

View File

@ -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;