Skip to content

Commit d54005f

Browse files
committed
Fix error when no image is present
1 parent 882744a commit d54005f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const getImageSrc = (activeFilePath: string, plugin: FrontmatterImagePlug
99
.map(key => frontmatter[key])
1010
.find(value => !!value);
1111

12+
if (!rawValue) return;
13+
1214
// Extract image from wikilink format: [[img.jpg|...]] or [[img.jpg]]
1315
const wikilinkMatch = rawValue.match(/^\[\[([^|\]]+)(?:\|[^\]]+)?\]\]$/);
1416
if (wikilinkMatch) {

0 commit comments

Comments
 (0)