From 48ca33761fd221459ceea6bb8f579d3286bd0ef4 Mon Sep 17 00:00:00 2001 From: Glandos Date: Sun, 6 Nov 2022 19:23:23 +0100 Subject: [PATCH] Test valid path only if file info has to be retrieved Signed-off-by: Glandos --- lib/private/Files/Node/Node.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index bfa4d6861ea..8a752ff281d 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -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; -- 2.39.5