[FIX] web_editor_class_selector: Avoid errors when custom CSS class is not present

Go to the website
Open the editor
Add text and select it, a traceback is shown
This commit is contained in:
Carlos Lopez
2024-09-27 13:11:16 -05:00
parent b3d68c753e
commit f1b94ad628

View File

@@ -11,7 +11,7 @@ import {OdooEditor} from "@web_editor/js/editor/odoo-editor/src/OdooEditor";
patch(OdooEditor.prototype, "web_editor_class_selector.OdooEditor", {
_updateToolbar(show) {
const res = this._super(show);
if (!this.toolbar) {
if (!this.toolbar || !this.custom_class_css) {
return res;
}
const sel = this.document.getSelection();