Verify if path exists

We need to verify if the specified path exists to gracefully prevent errors.
remotes/origin/poc-doctrine-migrations
Lukas Reschke 2015-06-17 15:06:50 +07:00
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;