improve reuse in getUserFolder
This commit is contained in:
parent
f77ce8829c
commit
c864420d6c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue