From 8f129d7bb4f2b1ab56b584b5aa6446c1364b53ff Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Thu, 17 Dec 2020 14:00:01 +0100 Subject: [PATCH] Fix bug in sshfs.disconnect command --- src/manager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/manager.ts b/src/manager.ts index 637c7cb..731df95 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -226,7 +226,7 @@ export class Manager implements vscode.TaskProvider { .filter(con => con.actualConfig.name === target); } for (const con of cons) this.connectionManager.closeConnection(con); - const folders = vscode.workspace.workspaceFolders!; + const folders = vscode.workspace.workspaceFolders || []; let start: number = folders.length; let left: vscode.WorkspaceFolder[] = []; for (const folder of folders) { @@ -236,6 +236,7 @@ export class Manager implements vscode.TaskProvider { left.push(folder); } }; + if (folders.length === left.length) return; vscode.workspace.updateWorkspaceFolders(start, folders.length - start, ...left); } public async commandTerminal(target: FileSystemConfig | Connection, uri?: vscode.Uri) {