Added guard for missing contentDocument

no refs

- in a rare edge case, its possible that `contentDocument` is not available due to component unmount, guards against erroring in such scenarios
This commit is contained in:
Rishabh 2021-06-24 21:47:31 +05:30
parent 87148b789c
commit 38202c1472

View File

@ -15,10 +15,12 @@ export default class Frame extends Component {
}
setupFrameBaseStyle() {
this.iframeHtml = this.node.contentDocument.documentElement;
this.iframeHead = this.node.contentDocument.head;
this.iframeRoot = this.node.contentDocument.body;
this.forceUpdate();
if (this.node.contentDocument) {
this.iframeHtml = this.node.contentDocument.documentElement;
this.iframeHead = this.node.contentDocument.head;
this.iframeRoot = this.node.contentDocument.body;
this.forceUpdate();
}
}
render() {