combine if statements

This commit is contained in:
Robin Appelman 2016-07-05 23:35:32 +02:00 committed by Lukas Reschke
parent 039f730700
commit d0e6fdba4d
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 10 additions and 13 deletions

View File

@ -285,19 +285,6 @@ class ShareController extends Controller {
throw $e; 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 = [];
$shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName(); $shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName();
$shareTmpl['owner'] = $share->getShareOwner(); $shareTmpl['owner'] = $share->getShareOwner();
@ -316,6 +303,16 @@ class ShareController extends Controller {
// Show file list // Show file list
$hideFileList = false; $hideFileList = false;
if ($share->getNode() instanceof \OCP\Files\Folder) { 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()); $shareTmpl['dir'] = $rootFolder->getRelativePath($folderNode->getPath());
/* /*