Skip to content

Commit

Permalink
add optional chaining in close()
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaUshio committed Dec 9, 2023
1 parent 51ee02d commit baed77a
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 @@ -112,7 +112,7 @@ export default class QuickPreviewPlugin extends Plugin {
return function () {
if (plugin.settings.disableCloseSuggest) return;
old.call(this);
this.manager.unload();
this.manager?.unload(); // close() can be called before open() at startup, so we need the optional chaining (?.)
}
}
});
Expand Down

0 comments on commit baed77a

Please sign in to comment.