From 80cda3b17468cdc354c6f9eba503d43d3ca09848 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 3dd7f82bff349..e7753842e4efc 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -158,6 +158,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());