From 11eba8d77902c8b115da541cc09a0472cf74aca3 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:11:42 -0400 Subject: [PATCH] Add Null Check On `diskAccount` (#10550) --- libs/common/src/platform/services/state.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/common/src/platform/services/state.service.ts b/libs/common/src/platform/services/state.service.ts index 70d2211a884..d46a5189a48 100644 --- a/libs/common/src/platform/services/state.service.ts +++ b/libs/common/src/platform/services/state.service.ts @@ -117,6 +117,13 @@ export class StateService< state.accounts = {}; } state.accounts[userId] = this.createAccount(); + + if (diskAccount == null) { + // Return early because we can't set the diskAccount.profile + // if diskAccount itself is null + return state; + } + state.accounts[userId].profile = diskAccount.profile; return state; });