mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(TemplateManager): Make sure TemplateFolder is a Folder
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
748f7dbbbe
commit
28c6c63cc5
1 changed files with 6 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue