summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-06-17 15:06:50 +0200
committerLukas Reschke <lukas@owncloud.com>2015-06-17 15:08:39 +0200
commitf4bc29a1e77cee3fdaf913a20b55fabc14675e26 (patch)
treed2fa72abcb3b6401cf5f74c1e37209172e1e3d05
parent448ee4e7a92e96a6a57e52384193342c7987de9f (diff)
downloadnextcloud-server-f4bc29a1e77cee3fdaf913a20b55fabc14675e26.tar.gz
nextcloud-server-f4bc29a1e77cee3fdaf913a20b55fabc14675e26.zip
Verify if path exists
We need to verify if the specified path exists to gracefully prevent errors.
-rw-r--r--apps/files_sharing/ajax/publicpreview.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index f5343a7ef26..833bd1b4333 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -46,6 +46,11 @@ $view = new \OC\Files\View('/' . $userId . '/files');
$pathId = $linkedItem['file_source'];
$path = $view->getPath($pathId);
+
+if($path === null) {
+ throw new \OCP\Files\NotFoundException();
+}
+
$pathInfo = $view->getFileInfo($path);
$sharedFile = null;