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 Roeland Jago Douma
parent 83330b8c4c
commit b8d0249b0e
1 changed files with 1 additions and 0 deletions

View File

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