diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 8dcf48c6c9..c18e1d9efb 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -225,9 +225,8 @@ function Editor (opts = {}, localRegistry) { } this.discard = function (path) { - if (currentSession !== path) { - delete sessions[path] - } + if (sessions[path]) delete sessions[path] + if (currentSession === path) currentSession = null } this.resize = function (useWrapMode) {