diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-12-16 08:27:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-16 08:27:32 +0100 |
commit | 2fae31fab7546d4ccdef402ba01246c091465f2f (patch) | |
tree | 4caf1baaf575b409ec57b8a969d7e84988fb7440 | |
parent | 0fe1a770d812b3c7cc2e68a2506689c104dda2ec (diff) | |
parent | c085c1bc45acb97b1f03d01e020ffdcbef00b92d (diff) | |
download | nextcloud-server-2fae31fab7546d4ccdef402ba01246c091465f2f.tar.gz nextcloud-server-2fae31fab7546d4ccdef402ba01246c091465f2f.zip |
Merge pull request #49876 from nextcloud/backport/49451/stable29
[stable29] fix(TemplateManager): Make sure TemplateFolder is a Folder
-rw-r--r-- | lib/private/Files/Template/TemplateManager.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index 46fd428b491..3ef12622440 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -186,9 +186,13 @@ class TemplateManager implements ITemplateManager { * @throws \OCP\Files\NotPermittedException * @throws \OC\User\NoUserException */ - private function getTemplateFolder(): Node { + private function getTemplateFolder(): Folder { if ($this->getTemplatePath() !== '') { - return $this->rootFolder->getUserFolder($this->userId)->get($this->getTemplatePath()); + $path = $this->rootFolder->getUserFolder($this->userId)->get($this->getTemplatePath()); + if ($path instanceof Folder) { + return $path; + } + $this->logger->warning('Template folder ' . $path . ' not found or invalid', ['app' => 'files_templates']); } throw new NotFoundException(); } |