aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-12-16 08:27:32 +0100
committerGitHub <noreply@github.com>2024-12-16 08:27:32 +0100
commit2fae31fab7546d4ccdef402ba01246c091465f2f (patch)
tree4caf1baaf575b409ec57b8a969d7e84988fb7440
parent0fe1a770d812b3c7cc2e68a2506689c104dda2ec (diff)
parentc085c1bc45acb97b1f03d01e020ffdcbef00b92d (diff)
downloadnextcloud-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.php8
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();
}