combine if statements
This commit is contained in:
parent
039f730700
commit
d0e6fdba4d
1 changed files with 10 additions and 13 deletions
|
@ -285,19 +285,6 @@ class ShareController extends Controller {
|
|||
throw $e;
|
||||
}
|
||||
|
||||
$rootFolder = null;
|
||||
if ($share->getNode() instanceof \OCP\Files\Folder) {
|
||||
/** @var \OCP\Files\Folder $rootFolder */
|
||||
$rootFolder = $share->getNode();
|
||||
|
||||
try {
|
||||
$folderNode = $rootFolder->get($path);
|
||||
} catch (\OCP\Files\NotFoundException $e) {
|
||||
$this->emitAccessShareHook($share, 404, 'Share not found');
|
||||
throw new NotFoundException();
|
||||
}
|
||||
}
|
||||
|
||||
$shareTmpl = [];
|
||||
$shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName();
|
||||
$shareTmpl['owner'] = $share->getShareOwner();
|
||||
|
@ -316,6 +303,16 @@ class ShareController extends Controller {
|
|||
// Show file list
|
||||
$hideFileList = false;
|
||||
if ($share->getNode() instanceof \OCP\Files\Folder) {
|
||||
/** @var \OCP\Files\Folder $rootFolder */
|
||||
$rootFolder = $share->getNode();
|
||||
|
||||
try {
|
||||
$folderNode = $rootFolder->get($path);
|
||||
} catch (\OCP\Files\NotFoundException $e) {
|
||||
$this->emitAccessShareHook($share, 404, 'Share not found');
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
$shareTmpl['dir'] = $rootFolder->getRelativePath($folderNode->getPath());
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue