diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-12-16 07:02:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-16 07:02:49 +0100 |
commit | ace16c1d47b32ba16d0d61cbf431b187ef5ddca1 (patch) | |
tree | 42bb606958266e0da454c1081b05c716b9d52e61 /lib | |
parent | 2db363b306ac3d141db8a621ec5742a073f789e7 (diff) | |
parent | efa615bb0149ac77a317f24710a8579d89fa4c34 (diff) | |
download | nextcloud-server-ace16c1d47b32ba16d0d61cbf431b187ef5ddca1.tar.gz nextcloud-server-ace16c1d47b32ba16d0d61cbf431b187ef5ddca1.zip |
Merge pull request #49451 from nextcloud/ensureTemplateFolder
fix(TemplateManager): Make sure TemplateFolder is a Folder
Diffstat (limited to 'lib')
-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 47011f875ae..5a3f16872e6 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -173,9 +173,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(); } |