Fix log error when creating files from an empty template

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2021-05-12 16:07:54 +02:00 committed by backportbot[bot]
parent 51e279918f
commit 80cda3b174
1 changed files with 1 additions and 0 deletions

View File

@ -158,6 +158,7 @@ class TemplateManager implements ITemplateManager {
} }
$folder = $userFolder->get(dirname($filePath)); $folder = $userFolder->get(dirname($filePath));
$targetFile = $folder->newFile(basename($filePath)); $targetFile = $folder->newFile(basename($filePath));
$template = null;
if ($templateType === 'user' && $templateId !== '') { if ($templateType === 'user' && $templateId !== '') {
$template = $userFolder->get($templateId); $template = $userFolder->get($templateId);
$template->copy($targetFile->getPath()); $template->copy($targetFile->getPath());