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