Skip to content

Commit

Permalink
fix(TemplateManager): Make sure TemplateFolder is a Folder
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf committed Dec 13, 2024
1 parent fef721e commit efa615b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/private/Files/Template/TemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ public function createFromTemplate(string $filePath, string $templateId = '', st
* @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();
}
Expand Down

0 comments on commit efa615b

Please sign in to comment.