From 38e518cfe651190185747e572fbc545c759a532b Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 5 Jun 2026 13:58:31 -0700 Subject: [PATCH] Fix TypeError on deactivate Fixes a TypeError caused due to a missing check on the `deactivate` method. --- src/extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 3a28d78f..219e6371 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -727,6 +727,8 @@ export async function disposeAll(disposables: IDisposable[]): Promise { export async function deactivate(context: ExtensionContext) { await disposeAll(context.subscriptions); - context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks + if (context.subscriptions?.length) { + context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks + } traceInfo('Python Environments extension deactivated.'); }