From 039f730700115f4595e8f12cca175af1ae630c51 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 5 Jul 2016 23:19:30 +0200 Subject: [PATCH] handle errors while getting fileinfo --- apps/files_sharing/ajax/shareinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php index 002d7ab275e..0b93e3d2ee9 100644 --- a/apps/files_sharing/ajax/shareinfo.php +++ b/apps/files_sharing/ajax/shareinfo.php @@ -71,7 +71,7 @@ $shareManager = \OC::$server->getShareManager(); $share = $shareManager->getShareByToken($token); $sharePermissions= (int)$share->getPermissions(); -if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { +if($rootInfo === false || !($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { OCP\JSON::error(array('data' => 'Share is not readable.')); exit(); } -- 2.39.5