From ecc8dc266a74dbd733472e6351e5a4ce64f72536 Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:14:56 +0200 Subject: [PATCH] Fix #259 --- src/template.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/template.ts b/src/template.ts index a13a51a..7d6914e 100644 --- a/src/template.ts +++ b/src/template.ts @@ -7,6 +7,11 @@ export async function applyTemplate( leaf?: WorkspaceLeaf | null, templatePath?: string ) { + const fileContent = await plugin.app.vault.read(file).catch((err) => { + console.error(`Error reading file ${file.path}:`, err); + }); + if (fileContent !== '') return; + const templateFile = templatePath ? plugin.app.vault.getAbstractFileByPath(templatePath) : null;