aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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 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();
}