1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

Validate an active user exists (#6695)

This commit is contained in:
Matt Gibson
2023-10-25 11:26:25 -04:00
committed by GitHub
parent e49f298330
commit 204f7631b4

View File

@@ -175,7 +175,7 @@ export class StateService<
// TODO: Temporary update to avoid routing all account status changes through account service for now. // TODO: Temporary update to avoid routing all account status changes through account service for now.
// account service tracks logged out accounts, but State service does not, so we need to add the active account // account service tracks logged out accounts, but State service does not, so we need to add the active account
// if it's not in the accounts list. // if it's not in the accounts list.
if (this.accountsSubject.value[state.activeUserId] == null) { if (state.activeUserId != null && this.accountsSubject.value[state.activeUserId] == null) {
const activeDiskAccount = await this.getAccountFromDisk({ userId: state.activeUserId }); const activeDiskAccount = await this.getAccountFromDisk({ userId: state.activeUserId });
this.accountService.addAccount(state.activeUserId as UserId, { this.accountService.addAccount(state.activeUserId as UserId, {
name: activeDiskAccount.profile.name, name: activeDiskAccount.profile.name,