Skip to content

Commit a3597cb

Browse files
committed
maybe fix error on settings load 2
1 parent 1f29c41 commit a3597cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/obsidian/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ export default class MetaBindPlugin extends Plugin implements IPlugin {
340340
async loadSettings(): Promise<void> {
341341
console.log(`meta-bind | Main >> settings load`);
342342

343-
const loadedSettings = (await this.loadData()) as MetaBindPluginSettings;
343+
const loadedSettings = ((await this.loadData()) ?? {}) as MetaBindPluginSettings;
344344

345-
if (typeof loadedSettings === 'object') {
345+
if (typeof loadedSettings === 'object' && loadedSettings != null) {
346346
// @ts-expect-error TS2339 remove old config field
347347
delete loadedSettings.inputTemplates;
348348
// @ts-expect-error TS2339 remove old config field

0 commit comments

Comments
 (0)