Merge branch 'master' of github.com:lukeleppan/better-word-count

This commit is contained in:
Luke Leppan 2023-01-24 21:15:38 +02:00
commit 6676fc69f4
No known key found for this signature in database
GPG key ID: D35B272CE58AE00A

View file

@ -72,7 +72,7 @@ export default class BetterWordCount extends Plugin {
giveEditorPlugin(leaf: WorkspaceLeaf): void { giveEditorPlugin(leaf: WorkspaceLeaf): void {
//@ts-expect-error, not typed //@ts-expect-error, not typed
const editor = leaf.view.editor; const editor = leaf?.view?.editor;
if (editor) { if (editor) {
const editorView = editor.cm as EditorView; const editorView = editor.cm as EditorView;
const editorPlug = editorView.plugin(editorPlugin); const editorPlug = editorView.plugin(editorPlugin);