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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user