Skip to content

Commit 74b646b

Browse files
committed
Do null check on model
1 parent 8ba3a59 commit 74b646b

File tree

1 file changed

+3
-5
lines changed
  • packages/app/src/app/components/CodeEditor/VSCode

1 file changed

+3
-5
lines changed

packages/app/src/app/components/CodeEditor/VSCode/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,12 @@ class MonacoEditor extends React.Component<Props> implements Editor {
888888

889889
this.lint = debounce(this.lint, 400);
890890

891-
if (this.editor.getActiveCodeEditor()) {
891+
const activeEditor = this.editor.getActiveCodeEditor();
892+
if (activeEditor && activeEditor.getModel()) {
892893
this.lint(
893894
this.getCode(),
894895
this.currentModule.title,
895-
this.editor
896-
.getActiveCodeEditor()
897-
.getModel()
898-
.getVersionId()
896+
activeEditor.getModel().getVersionId()
899897
);
900898
}
901899
}

0 commit comments

Comments
 (0)