Skip to content

Commit f71716d

Browse files
authored
Fix TypeError on deactivate (#1560)
Fixes a TypeError caused due to a missing check on the `deactivate` method. Fixes #1557
1 parent 5e13c47 commit f71716d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ export async function disposeAll(disposables: IDisposable[]): Promise<void> {
735735

736736
export async function deactivate(context: ExtensionContext) {
737737
await disposeAll(context.subscriptions);
738-
context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks
738+
if (context.subscriptions?.length) {
739+
context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks
740+
}
739741
traceInfo('Python Environments extension deactivated.');
740742
}

0 commit comments

Comments
 (0)