Merge pull request #26963 from nextcloud/bugfix/noid/empty-template-error

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