diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 2ed3d99ab1e..05f7c062ba4 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -924,7 +924,7 @@ const Wysiwyg = Widget.extend({ $node.replaceWith(element); this.odooEditor.unbreakableStepUnactive(); this.odooEditor.historyStep(); - } else { + } else if (element) { this.odooEditor.execCommand('insertHTML', element.outerHTML); } });