diff options
author | Simon L <szaimen@e.mail.de> | 2022-11-11 17:11:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 17:11:21 +0100 |
commit | 9d45845d2a6df7efdb07038c9bb7c345d4d5d819 (patch) | |
tree | 43ab90552cddebc9c33182c6eecb99957de7adeb | |
parent | abaa3ef61b9a6177ca3fe965e837e6e9bca16a4b (diff) | |
parent | 48ca33761fd221459ceea6bb8f579d3286bd0ef4 (diff) | |
download | nextcloud-server-9d45845d2a6df7efdb07038c9bb7c345d4d5d819.tar.gz nextcloud-server-9d45845d2a6df7efdb07038c9bb7c345d4d5d819.zip |
Merge pull request #34994 from Glandos/fileinfo_perf
[Performance] Test valid path only if file info has to be retrieved
-rw-r--r-- | lib/private/Files/Node/Node.php | 6 |
1 files 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; |