Skip to content

Commit c434056

Browse files
committed
Fix error when opening file with malformed frontmatter image string
1 parent 33f2f54 commit c434056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const getImageSrc = (activeFilePath: string, plugin: FrontmatterImagePlug
77

88
let rawValue = plugin.settings.imageKeys
99
.map(key => frontmatter[key])
10-
.find(value => !!value);
10+
.find((value): value is string => typeof value === "string" && !!value.trim());
1111

1212
if (!rawValue) return;
1313

0 commit comments

Comments
 (0)