From b8d0249b0e59fb1544074537cf25524622fd71af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 12 May 2021 16:07:54 +0200 Subject: [PATCH] Fix log error when creating files from an empty template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Files/Template/TemplateManager.php | 1 + 1 file changed, 1 insertion(+) 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());