1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ export class StateService<
// 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
// 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 });
this.accountService.addAccount(state.activeUserId as UserId, {
name: activeDiskAccount.profile.name,