Skip to content
Snippets Groups Projects
Commit a904a638 authored by Samuel Degueldre's avatar Samuel Degueldre Committed by qsm-odoo
Browse files

[FIX] web_editor: fix layoutInfo is null traceback


When attempting to update its UI in reaction to events, summernote tries
to make layout info for the event target, this relies on finding this
information on one of the target's ancestors. In some cases, elements
can be removed from the DOM between the moment the event was triggered,
and the moment summernote attempts to create the layoutInfo, resulting
in layoutInfo being null.

This commit prevents tracebacks from happening in such cases by checking
that a layoutInfo was actually returned, and if not, aborting the UI
update that relies on it.

closes odoo/odoo#52541

X-original-commit: 3e999db0
Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 4f64fa3e
No related branches found
No related tags found
No related merge requests found
......@@ -206,6 +206,9 @@ define([
setTimeout(function () {
var layoutInfo = dom.makeLayoutInfo(target);
/* ODOO: (start_modification */
if (!layoutInfo) {
return;
}
var $editable = layoutInfo.editable();
if (event.setStyleInfoFromEditable) {
var styleInfo = modules.editor.styleFromNode($editable);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment