File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"id" : " obsidian-meta-bind-plugin" ,
3
3
"name" : " Meta Bind Plugin" ,
4
- "version" : " 0.1.5 " ,
4
+ "version" : " 0.1.6 " ,
5
5
"minAppVersion" : " 0.14.0" ,
6
6
"description" : " This plugin can create input fields inside your notes and bind them to metadata fields." ,
7
7
"author" : " Moritz Jung" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " obsidian-meta-bind-plugin" ,
3
- "version" : " 0.1.5 " ,
3
+ "version" : " 0.1.6 " ,
4
4
"description" : " This plugin can create input fields inside your notes and bind them to metadata fields." ,
5
5
"main" : " main.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -123,8 +123,12 @@ export default class MetaBindPlugin extends Plugin {
123
123
124
124
let fileContent : string = await this . app . vault . read ( file ) ;
125
125
const regExp = new RegExp ( '^(---)\\n[\\s\\S]*\\n---' ) ;
126
- let frontMatter = regExp . exec ( fileContent ) [ 0 ] ;
127
- if ( frontMatter === null ) {
126
+ let frontMatterRegExpResult = regExp . exec ( fileContent ) ;
127
+ if ( ! frontMatterRegExpResult ) {
128
+ return { } ;
129
+ }
130
+ let frontMatter = frontMatterRegExpResult [ 0 ] ;
131
+ if ( ! frontMatter ) {
128
132
return { } ;
129
133
}
130
134
// console.log(frontMatter);
You can’t perform that action at this time.
0 commit comments