[FIX] web_editor: fix traceback when no image selected

closes odoo/odoo#77114

X-original-commit: aca97276446f8d9bd9977aeb665ae9a93d28a7bf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
David Monjoie
2021-09-24 11:09:09 +00:00
parent 43d7c0d6d3
commit df1267f4d6
@@ -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);
}
});