Skip to content

Commit 835a553

Browse files
committed
🐛 <PreviewFrame /> check for own iframe body tag before unmounting it
1 parent 69bd6cb commit 835a553

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: client/modules/IDE/components/PreviewFrame.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class PreviewFrame extends React.Component {
6464

6565
componentWillUnmount() {
6666
window.removeEventListener('message', this.handleConsoleEvent);
67-
ReactDOM.unmountComponentAtNode(this.iframeElement.contentDocument.body);
67+
const iframeBody = this.iframeElement.contentDocument.body;
68+
if (iframeBody) { ReactDOM.unmountComponentAtNode(iframeBody); }
6869
}
6970

7071
handleConsoleEvent(messageEvent) {

0 commit comments

Comments
 (0)