diff --git a/addons/website/static/src/client_actions/website_preview/website_preview.js b/addons/website/static/src/client_actions/website_preview/website_preview.js index 851936b6775..f8e1f8aa16b 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview.js +++ b/addons/website/static/src/client_actions/website_preview/website_preview.js @@ -475,7 +475,7 @@ export class WebsitePreview extends Component { } } _onPageHide() { - this.lastHiddenPageURL = this.iframe.el.contentWindow.location.href; + this.lastHiddenPageURL = this.iframe.el && this.iframe.el.contentWindow.location.href; // Normally, at this point, the websiteRootInstance is already set to // `undefined`, as we want to do that as early as possible to prevent // the editor to be in an unstable state. But some events not managed