From fba6929301012dba7f82e213edfe8ff219387ddd Mon Sep 17 00:00:00 2001 From: Damien Duhamel Date: Thu, 7 Dec 2017 10:14:39 +0100 Subject: [PATCH] Change historyOfTypeIsValid condition --- .../Markdown/MarkdownControl/VisualEditor/keys.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor/keys.js b/src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor/keys.js index 9e40cd35..a13f0552 100644 --- a/src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor/keys.js +++ b/src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor/keys.js @@ -21,7 +21,8 @@ function changeHistory(change, type) { */ const next = historyOfType.first(); const historyOfTypeIsValid = historyOfType.size > 1 - || ( next && next.length > 1 && next[0].type !== 'set_selection' ); + || (next && next.length > 1) + || (next && next[0] && next[0].type !== 'set_selection'); if (historyOfTypeIsValid) { change[type]();