From 204f7631b44670fa564a7b419cea9a1898ceda10 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Wed, 25 Oct 2023 11:26:25 -0400 Subject: [PATCH] Validate an active user exists (#6695) --- libs/common/src/platform/services/state.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common/src/platform/services/state.service.ts b/libs/common/src/platform/services/state.service.ts index aa8ffb8a6f4..78bfddd6e9e 100644 --- a/libs/common/src/platform/services/state.service.ts +++ b/libs/common/src/platform/services/state.service.ts @@ -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,