Skip to content

Commit d59072d

Browse files
committed
Add if statement
1 parent 1907878 commit d59072d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jderobot-ide-interface",
3-
"version": "0.1.88",
3+
"version": "0.1.89",
44
"main": "dist/main.js",
55
"typings": "dist/index.d.ts",
66
"files": [

src/components/FileEditor/TextEditor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ const FileEditor = ({
151151
monacoRef.current = monaco;
152152
editorRef.current = editor;
153153

154-
editorRef.current.getDomNode().addEventListener("keydown", handleKeyDown);
154+
if (editorRef.current) {
155+
editorRef.current.getDomNode().addEventListener("keydown", handleKeyDown);
156+
}
155157

156158
monacoEditorSnippet(monaco, commsManager);
157159

0 commit comments

Comments
 (0)