mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Verify if path exists
We need to verify if the specified path exists to gracefully prevent errors.
This commit is contained in:
parent
a89bb1d383
commit
2d648ed0eb
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue