Skip to content

Commit 6067f13

Browse files
authored
Add null check for session in accountsEntitlements (microsoft#213933)
1 parent 135c59a commit 6067f13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/accountEntitlements/browser/accountsEntitlements.contribution.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut
151151
return [true, orgs && orgs.length > 0 ? (orgs[0].name ? orgs[0].name : orgs[0].login) : undefined];
152152
}
153153

154-
private async enableEntitlements(session: AuthenticationSession) {
154+
private async enableEntitlements(session: AuthenticationSession | undefined) {
155+
if (!session) {
156+
return;
157+
}
158+
155159
const isInternal = isInternalTelemetry(this.productService, this.configurationService);
156160
const showAccountsBadge = this.configurationService.inspect<boolean>(accountsBadgeConfigKey).value ?? false;
157161
const showWelcomeView = this.configurationService.inspect<boolean>(chatWelcomeViewConfigKey).value ?? false;

0 commit comments

Comments
 (0)