From be3a5aa3df158f3f847dadbabeed2fe112d12506 Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Mon, 7 Feb 2022 07:24:58 +0200 Subject: [PATCH] fix: :bug: Don't add empty BC-note-fields to eligableAlts (#326) --- main.js | 2 +- src/refreshIndex.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index b735de20..e89648b6 100644 --- a/main.js +++ b/main.js @@ -35399,7 +35399,7 @@ async function buildMainG(plugin) { db.start2G("addFrontmatterToGraph"); frontms.forEach((page) => { BC_ALTS.forEach((alt) => { - if (page[alt] !== undefined) + if (page[alt] !== undefined && page[alt] !== null) eligableAlts[alt].push(page); }); const basename = getDVBasename(page.file); diff --git a/src/refreshIndex.ts b/src/refreshIndex.ts index 40f7560e..9a94f132 100644 --- a/src/refreshIndex.ts +++ b/src/refreshIndex.ts @@ -198,7 +198,8 @@ export async function buildMainG(plugin: BCPlugin): Promise { db.start2G("addFrontmatterToGraph"); frontms.forEach((page) => { BC_ALTS.forEach((alt) => { - if (page[alt] !== undefined) eligableAlts[alt].push(page); + if (page[alt] !== undefined && page[alt] !== null) + eligableAlts[alt].push(page); }); const basename = getDVBasename(page.file);