mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #49877 from nextcloud/backport/49451/stable30
[stable30] fix(TemplateManager): Make sure TemplateFolder is a Folder
This commit is contained in:
commit
35c0ed1199
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