From e38cdb555803b5945cd46ef2901d7e3edbc46e2b Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Mon, 8 May 2023 16:55:04 -0700 Subject: [PATCH] Fix startup telemetry issue --- src/client/startupTelemetry.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/startupTelemetry.ts b/src/client/startupTelemetry.ts index 8a123d6bee36..f4d3fc254b67 100644 --- a/src/client/startupTelemetry.ts +++ b/src/client/startupTelemetry.ts @@ -89,7 +89,9 @@ async function getActivationTelemetryProps(serviceContainer: IServiceContainer): return { workspaceFolderCount, terminal: terminalShellType }; } const interpreterService = serviceContainer.get(IInterpreterService); - const mainWorkspaceUri = workspaceService.workspaceFolders ? workspaceService.workspaceFolders[0].uri : undefined; + const mainWorkspaceUri = workspaceService.workspaceFolders?.length + ? workspaceService.workspaceFolders[0].uri + : undefined; const hasPythonThree = await interpreterService.hasInterpreters(async (item) => item.version?.major === 3); // If an unknown type environment can be found from windows registry or path env var, // consider them as global type instead of unknown. Such types can only be known after