fix: prevent undefined access

This commit is contained in:
Baptiste Grob
2020-09-17 14:28:52 +02:00
parent 083b2f5dfd
commit 2ba43a01ed

View File

@@ -379,7 +379,7 @@ class NotesViewCtrl extends PureViewCtrl<{}, NotesState> {
}
async handleEditorChange() {
const activeNote = this.appState.getActiveEditor().note;
const activeNote = this.appState.getActiveEditor()?.note;
if (activeNote && activeNote.conflictOf) {
this.application!.changeAndSaveItem(activeNote.uuid, (mutator) => {
mutator.conflictOf = undefined;