From 5934f2f08e8fdd85036e8b0fbecbb0c0de8e39f5 Mon Sep 17 00:00:00 2001 From: Luis Orozco <6557454+innocuo@users.noreply.github.com> Date: Mon, 6 May 2019 15:30:04 -0500 Subject: [PATCH] Desktop: Fixes #355: Resets the undo manager when creating new notes (#1495) --- ElectronClient/app/gui/NoteText.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index 27396f9544..5c07733f51 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -501,7 +501,7 @@ class NoteTextComponent extends React.Component { // 2. It resets the undo manager - fixes https://github.com/laurent22/joplin/issues/355 // Note: calling undoManager.reset() doesn't work try { - this.editor_.editor.getSession().setValue(note ? note.body : ''); + this.editor_.editor.getSession().setValue(note && note.body? note.body : ''); } catch (error) { if (error.message === "Cannot read property 'match' of undefined") { // The internals of Ace Editor throws an exception when creating a new note,