Skip to content

Commit

Permalink
fix: calling setMode just before destroy causes error reading getLength
Browse files Browse the repository at this point in the history
  • Loading branch information
nlujjawal committed Nov 21, 2024
1 parent 442680c commit bf4b461
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/edit_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ class EditSession {
// load on demand
this.$modeId = path;
config.loadModule(["mode", path], function(m) {
if(this.destroyed){
return;

Check warning on line 937 in src/edit_session.js

View check run for this annotation

Codecov / codecov/patch

src/edit_session.js#L937

Added line #L937 was not covered by tests
}
if (this.$modeId !== path)
return cb && cb();
if (this.$modes[path] && !options) {
Expand Down

0 comments on commit bf4b461

Please sign in to comment.