mirror of
https://github.com/jacobtread/obsidian-timekeep.git
synced 2026-07-22 10:10:27 +00:00
fix: check file is file using instanceof instead of cast
This commit is contained in:
parent
c1fbc735e9
commit
33db60aa67
1 changed files with 2 additions and 4 deletions
|
|
@ -128,12 +128,10 @@ class TimekeepComponent extends MarkdownRenderChild {
|
|||
// Ensure we actually have a section to write to
|
||||
if (sectionInfo === null) return;
|
||||
|
||||
const file = this.vault.getAbstractFileByPath(
|
||||
this.context.sourcePath
|
||||
) as TFile | null;
|
||||
const file = this.vault.getAbstractFileByPath(this.context.sourcePath);
|
||||
|
||||
// Ensure the file still exists
|
||||
if (file === null) return;
|
||||
if (file === null || !(file instanceof TFile)) return;
|
||||
|
||||
try {
|
||||
const content = await this.vault.read(file);
|
||||
|
|
|
|||
Loading…
Reference in a new issue