1
0
mirror of https://github.com/bitwarden/jslib synced 2026-01-04 01:23:14 +00:00

[bug] Create a State if one is requested from memory before it exists

This commit is contained in:
addison
2021-11-16 12:42:18 -05:00
parent 420c4184e9
commit ba7d7f1028

View File

@@ -1274,7 +1274,7 @@ export class StateService implements StateServiceAbstraction {
this.secureStorageService :
this.storageService;
const state = await storageLocation.get<State>('state', options);
const state = await storageLocation.get<State>('state', options) ?? new State();
state.accounts[account.userId] = account;
await storageLocation.save('state', state, options);