From df1267f4d62dee4c05967e5d02b1fc3049c25f43 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Thu, 23 Sep 2021 11:47:53 +0000 Subject: [PATCH] [FIX] web_editor: fix traceback when no image selected closes odoo/odoo#77114 X-original-commit: aca97276446f8d9bd9977aeb665ae9a93d28a7bf Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } });