diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index ae29fa117f2..2f1a60a02a7 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -776,7 +776,7 @@ const Wysiwyg = Widget.extend({ * Set cursor to the editor latest position before blur or to the last editable node, ready to type. */ focus: function () { - if (!this.odooEditor.historyResetLatestComputedSelection()) { + if (this.odooEditor && !this.odooEditor.historyResetLatestComputedSelection()) { // If the editor don't have an history step to focus to, // We place the cursor after the end of the editor exiting content. const range = document.createRange();