Skip to content

Commit

Permalink
fix: crash if dataview not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Sep 5, 2022
1 parent 887ed5b commit f7de231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/contents_conversion/convertText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function convertInlineDataview(text: string, settings: GitHubPublisherSett
* stringify with extract alt text for links
*/
// @ts-ignore
if (settings.dataviewFields.length === 0 || app.plugins.enabledPlugins['dataview'] === undefined) {
if (settings.dataviewFields.length === 0 || !app.plugins.enabledPlugins.has('dataview')) {
return text;
}
const dvApi = getAPI();
Expand Down Expand Up @@ -171,7 +171,7 @@ async function convertDataviewQueries(
*/
/* Credit : Ole Eskild Steensen from Obsidian Digital Garden */
// @ts-ignore
if (app.plugins.enabledPlugins['dataview'] === undefined) {
if (!app.plugins.enabledPlugins.has('dataview')) {
return text;
}
const vault = app.vault;
Expand Down

0 comments on commit f7de231

Please sign in to comment.