diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index 0351e122658e6..c10c13c35b08c 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -159,6 +159,7 @@ public function createFromTemplate(string $filePath, string $templateId = '', st } $folder = $userFolder->get(dirname($filePath)); $targetFile = $folder->newFile(basename($filePath)); + $template = null; if ($templateType === 'user' && $templateId !== '') { $template = $userFolder->get($templateId); $template->copy($targetFile->getPath());