diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index 0accc487c96..9e19f1ccb48 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -427,6 +427,16 @@ export class WysiwygAdapterComponent extends ComponentAdapter { */ _websiteRootEvent(type, eventData = {}) { const websiteRootInstance = this.websiteService.websiteRootInstance; + // If the websiteRootInstance is gone but an event still tries to reach it + // prevent a traceback by denying the event. + // TODO we should investigate if this is normal the websiteRootInstance + // is being accessed while being dead following a wysiwyg adapter event. + if (!websiteRootInstance) { + if (eventData.onFailure) { + return eventData.onFailure(); + } + return false; + } return websiteRootInstance.trigger_up(type, {...eventData}); } _preventDefault(e) {