Skip to content

Commit

Permalink
revert to empty array if dv is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jun 30, 2021
1 parent 8295d72 commit 3e7a01b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ export function getFileFrontmatterArr(
if (settings.superDebugMode) {
console.log(`Get frontmatter: ${file.basename}`);
}
const dv: FrontMatterCache = app.plugins.plugins.dataview.api.page(
file.path
);
const dv: FrontMatterCache =
app.plugins.plugins.dataview.api.page(file.path) ?? [];

if (settings.superDebugMode) {
console.log({ dv });
}
fileFrontMatterArr.push({ file, frontmatter: dv });
});
});
Expand Down

0 comments on commit 3e7a01b

Please sign in to comment.