Skip to content

Commit a731ed5

Browse files
committed
Prevent page unloading in case of unknown editor
Recently, we observed an issue with a missing `editor_for_file`, which caused a `turbo:visit` event and unloaded the editor. By preventing the bug, the page is not unloaded and continuous to work as expected (despite clicking on the line won't do anything, which is less severe). Fixes CODEOCEAN-FRONTEND-DR
1 parent 3a0bacd commit a731ed5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/assets/javascripts/editor/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ var CodeOceanEditor = {
723723
this.selectFileInJsTree($('#files'), file_id);
724724

725725
const editor = this.editor_for_file.get(file_id);
726-
editor.gotoLine(line, 0);
726+
editor?.gotoLine(line, 0);
727727
event.preventDefault();
728728
},
729729

0 commit comments

Comments
 (0)