summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controllers
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-07-05 23:35:32 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-07-08 12:36:15 +0200
commitd0e6fdba4d38ad7d7d7e95ec4cb752d8b609af5c (patch)
tree66d8aa5e67feb33a082e4809e5b4d286eec8a7e3 /apps/files_sharing/lib/Controllers
parent039f730700115f4595e8f12cca175af1ae630c51 (diff)
downloadnextcloud-server-d0e6fdba4d38ad7d7d7e95ec4cb752d8b609af5c.tar.gz
nextcloud-server-d0e6fdba4d38ad7d7d7e95ec4cb752d8b609af5c.zip
combine if statements
Diffstat (limited to 'apps/files_sharing/lib/Controllers')
-rw-r--r--apps/files_sharing/lib/Controllers/ShareController.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/apps/files_sharing/lib/Controllers/ShareController.php b/apps/files_sharing/lib/Controllers/ShareController.php
index c439735c065..11359e5f2f2 100644
--- a/apps/files_sharing/lib/Controllers/ShareController.php
+++ b/apps/files_sharing/lib/Controllers/ShareController.php
@@ -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());
/*