diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-11-23 08:07:31 +0100 |
---|---|---|
committer | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-12-13 11:27:54 +0100 |
commit | efa615bb0149ac77a317f24710a8579d89fa4c34 (patch) | |
tree | 46f530a505afa43f8ed53adaed18b42f0ec9151b /lib | |
parent | fef721e6419df12ccd8606270a6b6eb26e5b01f4 (diff) | |
download | nextcloud-server-efa615bb0149ac77a317f24710a8579d89fa4c34.tar.gz nextcloud-server-efa615bb0149ac77a317f24710a8579d89fa4c34.zip |
fix(TemplateManager): Make sure TemplateFolder is a FolderensureTemplateFolder
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
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(); } |