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 Nov 25, 2024
1 parent c9bd003 commit 56de083
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/private/Files/Template/TemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ public function createFromTemplate(string $filePath, string $templateId = '', st
*/
private function getTemplateFolder(): Node {
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;
}
}
throw new NotFoundException();
throw new NotFoundException('Template folder not found or invalid');
}

/**
Expand Down

0 comments on commit 56de083

Please sign in to comment.