mirror of
https://github.com/decaf-dev/obsidian-vault-explorer.git
synced 2026-07-22 10:10:31 +00:00
fix: resolve crash from undefined value in frontmatter
This commit is contained in:
parent
f55cce9634
commit
bf4ac7ee2a
2 changed files with 6 additions and 6 deletions
|
|
@ -136,11 +136,6 @@ export const formatFileDataForRender = ({
|
|||
}
|
||||
}
|
||||
|
||||
const textProperties: FileTextProperties = loadTextProperties(
|
||||
app,
|
||||
fileFrontmatter
|
||||
);
|
||||
|
||||
let imageUrl: string | null = null;
|
||||
|
||||
//Handle image extension
|
||||
|
|
@ -168,6 +163,11 @@ export const formatFileDataForRender = ({
|
|||
|
||||
//Handle image in frontmatter
|
||||
if (imageUrl === null && coverImageSource !== "off") {
|
||||
const textProperties: FileTextProperties = loadTextProperties(
|
||||
app,
|
||||
fileFrontmatter
|
||||
);
|
||||
|
||||
for (const property of textProperties) {
|
||||
const { value } = property;
|
||||
const uri = getURIForWikiLink(app, value, path);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export const loadTextProperties = (
|
|||
|
||||
for (const entry of Object.entries(frontmatter)) {
|
||||
const [key, value] = entry;
|
||||
if (value === null) {
|
||||
if (value === undefined || value === null) {
|
||||
continue;
|
||||
}
|
||||
const isTextProperty = allTextProperties.find((p) => p.name === key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue