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; });