mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Fixed Cannot set properties of null (setting 'scrollTop')
errors in <GhHtmlIframe>
closes sentry ADMIN-C7S - we can't guarantee that the iframe being swapped to has rendered yet at the time we swap iframes so we need a guard around the `contentDocument.body` property existing before setting it's `scrollTop` value
This commit is contained in:
parent
c5abef057c
commit
37d9e8bb8b
@ -69,7 +69,9 @@ export default class GhHtmlIframeComponent extends Component {
|
||||
}
|
||||
this._lastPageId = this.args.pageId;
|
||||
|
||||
this.iframes[this.toRenderIframe].contentDocument.body.scrollTop = newScrollTop;
|
||||
if (this.iframes[this.toRenderIframe].contentDocument.body) {
|
||||
this.iframes[this.toRenderIframe].contentDocument.body.scrollTop = newScrollTop;
|
||||
}
|
||||
this.iframes[this.toRenderIframe].style = this.visibleIframeStyle;
|
||||
this.renderedIframe = this.toRenderIframe;
|
||||
this.toRenderIframe = this.toRenderIframe === 0 ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user