Return if editor is not defined

Fixes CODEOCEAN-FRONTEND-3A
This commit is contained in:
kiragrammel
2023-09-14 12:17:36 +02:00
committed by Sebastian Serth
parent 51fc44c2da
commit d224a099e0

View File

@ -1011,7 +1011,10 @@ var CodeOceanEditor = {
}, },
applyChanges: function (delta, active_file) { applyChanges: function (delta, active_file) {
const editor = this.editor_for_file.get(active_file.id) const editor = this.editor_for_file.get(active_file.id);
if (editor === undefined) {
return;
}
editor.session.doc.applyDeltas([delta]); editor.session.doc.applyDeltas([delta]);
}, },