From d4f0c640036fcdc118544b74675c9cbd6eac5b2c Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 27 Mar 2018 19:06:47 +0200 Subject: [PATCH] explorer: do not react on events if you are disposed fixes #46565 --- .../parts/files/electron-browser/views/explorerView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 5ee30960d13..62162c145af 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -227,7 +227,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE] = activeFile.toString(); // Select file if input is inside workspace - if (this.isVisible() && this.contextService.isInsideWorkspace(activeFile)) { + if (this.isVisible() && !this.isDisposed && this.contextService.isInsideWorkspace(activeFile)) { const selection = this.hasSingleSelection(activeFile); if (!selection) { this.select(activeFile).done(null, errors.onUnexpectedError); @@ -701,7 +701,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView } private refreshFromEvent(newRoots: IWorkspaceFolder[] = []): void { - if (this.isVisible()) { + if (this.isVisible() && !this.isDisposed) { this.explorerRefreshDelayer.trigger(() => { if (!this.explorerViewer.getHighlight()) { return this.doRefresh(newRoots.map(r => r.uri)).then(() => { -- GitLab