Skip to content

Commit 4b35933

Browse files
committed
Fix TypeError on deactivate
Fixes a TypeError caused due to a missing check on the `deactivate` method.
1 parent dc598c8 commit 4b35933

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

package-lock.json

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extension.ts

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

728728
export async function deactivate(context: ExtensionContext) {
729729
await disposeAll(context.subscriptions);
730-
context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks
730+
if (context.subscriptions?.length) {
731+
context.subscriptions.length = 0; // Clear subscriptions to prevent memory leaks
732+
}
731733
traceInfo('Python Environments extension deactivated.');
732734
}

0 commit comments

Comments
 (0)