From 661fbc9ecfffb930f7aba408749a193eaa4038bc Mon Sep 17 00:00:00 2001 From: Josh Abernathy Date: Thu, 29 Jun 2023 16:06:41 -0400 Subject: [PATCH] Fix removing tunnels when the tunnel factory throws an error (#186566) * Await the tunnel promise * Add null check * nit: use undefined --------- Co-authored-by: Alex Ross --- src/vs/platform/tunnel/common/tunnel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/tunnel/common/tunnel.ts b/src/vs/platform/tunnel/common/tunnel.ts index 6e362a7be5c..8f46ec11b60 100644 --- a/src/vs/platform/tunnel/common/tunnel.ts +++ b/src/vs/platform/tunnel/common/tunnel.ts @@ -416,7 +416,7 @@ export abstract class AbstractTunnelService implements ITunnelService { const hostMap = this._tunnels.get(remoteHost); if (hostMap) { const tunnel = hostMap.get(remotePort); - const tunnelResult = await tunnel; + const tunnelResult = tunnel ? await tunnel.value : undefined; if (!tunnelResult) { hostMap.delete(remotePort); }