mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
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:
parent
87148b789c
commit
38202c1472
1 changed files with 6 additions and 4 deletions
|
@ -15,11 +15,13 @@ export default class Frame extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
setupFrameBaseStyle() {
|
setupFrameBaseStyle() {
|
||||||
|
if (this.node.contentDocument) {
|
||||||
this.iframeHtml = this.node.contentDocument.documentElement;
|
this.iframeHtml = this.node.contentDocument.documentElement;
|
||||||
this.iframeHead = this.node.contentDocument.head;
|
this.iframeHead = this.node.contentDocument.head;
|
||||||
this.iframeRoot = this.node.contentDocument.body;
|
this.iframeRoot = this.node.contentDocument.body;
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {children, head, title = '', style = {}, ...rest} = this.props;
|
const {children, head, title = '', style = {}, ...rest} = this.props;
|
||||||
|
|
Loading…
Add table
Reference in a new issue