Skip to content

Commit 48ce4f0

Browse files
committed
[FIX] web_editor: prevent traceback on create and quick discard mailing
In mass_mailing: 1. Click CREATE 2. As soon as it appears, click "DISCARD" 3. Wait a little bit -> A traceback appeared. That is because wysiwyg was still busy starting and, in that process, requested the window object of the iframe that was already removed. closes odoo#84309 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
1 parent 6f9eeef commit 48ce4f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

addons/web_editor/static/src/js/wysiwyg/wysiwyg.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,10 @@ const Wysiwyg = Widget.extend({
12251225
const eventName = elem.dataset.eventName;
12261226
let colorpicker = null;
12271227
const mutex = new concurrency.MutexedDropPrevious();
1228+
if (!elem.ownerDocument.defaultView) {
1229+
// In case the element is not in the DOM, don't do anything with it.
1230+
continue;
1231+
}
12281232
// If the element is within an iframe, access the jquery loaded in
12291233
// the iframe because it is the one who will trigger the dropdown
12301234
// events (i.e hide.bs.dropdown and show.bs.dropdown).

0 commit comments

Comments
 (0)