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]();