Skip to content

Commit

Permalink
Fix error from files with no metadata (#51, #54)
Browse files Browse the repository at this point in the history
  • Loading branch information
noatpad committed Apr 20, 2022
1 parent 9ea94de commit d647eec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export default class BannersPlugin extends Plugin {
// Helper to wrap banner source in quotes if not already (Patch for previous versions)
async lintBannerSource(file: TFile) {
if (!file) { return }
const { src } = this.metaManager.getBannerDataFromFile(file);
const { src } = this.metaManager.getBannerDataFromFile(file) ?? {};
if (src && typeof src === 'string') {
await this.metaManager.upsertBannerData(file, { src: `"${src}"` });
}
Expand Down

0 comments on commit d647eec

Please sign in to comment.