Skip to content

Commit c0f3051

Browse files
author
Ives van Hoorne
committed
Check if editor exists when trying to dispose
1 parent 54dfeb2 commit c0f3051

File tree

1 file changed

+3
-1
lines changed
  • src/app/components/sandbox/CodeEditor

1 file changed

+3
-1
lines changed

src/app/components/sandbox/CodeEditor/Monaco.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ export default class CodeEditor extends React.PureComponent<Props, State> {
613613
componentWillUnmount() {
614614
window.removeEventListener('resize', this.resizeEditor);
615615
this.disposeModules();
616-
this.editor.dispose();
616+
if (this.editor) {
617+
this.editor.dispose();
618+
}
617619
this.syntaxWorker.terminate();
618620
this.lintWorker.terminate();
619621
this.typingsFetcherWorker.terminate();

0 commit comments

Comments
 (0)