From 1d1e934db2f6e956d8e6e5567263ef4c33739cf5 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Tue, 30 Aug 2022 14:41:54 +0000 Subject: [PATCH] [FIX] web_editor: ensure _makeHint receives an element Make a hint in the editor only if the first element is an element, otherwise the method `_makeHint` would crash. task-2898432 Part-of: odoo/odoo#94875 --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 2001fff2381..da1d459b2da 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -3372,7 +3372,7 @@ export class OdooEditor extends EventTarget { } // placeholder hint - if (this.editable.textContent === '' && this.options.placeholder) { + if (this.editable.textContent === '' && this.options.placeholder && this.editable.firstChild.innerHTML) { this._makeHint(this.editable.firstChild, this.options.placeholder, true); } }