summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax
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:06:50 +0200
commit2d648ed0eb301ed35db568071325bdc7e0428eb9 (patch)
tree85f054b746befc6dcce020cc6289ee7c67b6375d /apps/files_sharing/ajax
parenta89bb1d3839b80f8846b0ed9e462a42065d4ad9f (diff)
downloadnextcloud-server-2d648ed0eb301ed35db568071325bdc7e0428eb9.tar.gz
nextcloud-server-2d648ed0eb301ed35db568071325bdc7e0428eb9.zip
Verify if path exists
We need to verify if the specified path exists to gracefully prevent errors.
Diffstat (limited to 'apps/files_sharing/ajax')
-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 7685cda9d71..fff1a60b24e 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -63,6 +63,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;