Add Null Check On `diskAccount` (#10550)

This commit is contained in:
Justin Baur 2024-08-27 13:11:42 -04:00 committed by GitHub
parent 3fc1b5731c
commit 11eba8d779
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

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