Skip to content

Commit 97c3b35

Browse files
authored
Merge pull request #1490 from ghalestrilo/fix/mobile-crash-on-leave-preview
Fixes #1487
2 parents 5e0d522 + 835a553 commit 97c3b35

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)