Merge pull request #27021 from nextcloud/backport/26963/stable21

[stable21] Fix log error when creating files from an empty template
This commit is contained in:
Roeland Jago Douma 2021-05-19 10:28:38 +02:00 committed by GitHub
commit 3306c2fb35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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());