Merge pull request #68 from bakuzan/master
Protect against leaf not existing when obsidian first starts up.
This commit is contained in:
commit
07cdeffa31
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ export default class BetterWordCount extends Plugin {
|
|||
|
||||
giveEditorPlugin(leaf: WorkspaceLeaf): void {
|
||||
//@ts-expect-error, not typed
|
||||
const editor = leaf.view.editor;
|
||||
const editor = leaf?.view?.editor;
|
||||
if (editor) {
|
||||
const editorView = editor.cm as EditorView;
|
||||
const editorPlug = editorView.plugin(editorPlugin);
|
||||
|
|
Loading…
Reference in a new issue