Test valid path only if file info has to be retrieved

Signed-off-by: Glandos <bugs-github@antipoul.fr>
This commit is contained in:
Glandos 2022-11-06 19:23:23 +01:00
parent 7f2c21f056
commit 48ca33761f

View file

@ -99,10 +99,10 @@ class Node implements \OCP\Files\Node {
* @throws NotFoundException
*/
public function getFileInfo() {
if (!Filesystem::isValidPath($this->path)) {
throw new InvalidPathException();
}
if (!$this->fileInfo) {
if (!Filesystem::isValidPath($this->path)) {
throw new InvalidPathException();
}
$fileInfo = $this->view->getFileInfo($this->path);
if ($fileInfo instanceof FileInfo) {
$this->fileInfo = $fileInfo;