diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-17 15:06:50 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-17 15:08:39 +0200 |
commit | f4bc29a1e77cee3fdaf913a20b55fabc14675e26 (patch) | |
tree | d2fa72abcb3b6401cf5f74c1e37209172e1e3d05 | |
parent | 448ee4e7a92e96a6a57e52384193342c7987de9f (diff) | |
download | nextcloud-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.php | 5 |
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; |