1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00

Add null check to electronStorageService.Save (#461)

* Add default value for ForcePasswordReset

* Add null check to electronStorageService instead

* Add default value to ForcePasswordReset

* Update electron/src/services/electronStorage.service.ts

* Fix indention issue from GH suggestion

Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
This commit is contained in:
Thomas Rittson 2021-08-21 00:01:50 +10:00 committed by GitHub
parent f1f5d1a7f2
commit 358260596b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,7 @@ export class ProfileResponse extends BaseResponse {
this.key = this.getResponseProperty('Key');
this.privateKey = this.getResponseProperty('PrivateKey');
this.securityStamp = this.getResponseProperty('SecurityStamp');
this.forcePasswordReset = this.getResponseProperty('ForcePasswordReset');
this.forcePasswordReset = this.getResponseProperty('ForcePasswordReset') ?? false;
const organizations = this.getResponseProperty('Organizations');
if (organizations != null) {

View File

@ -46,6 +46,9 @@ export class ElectronStorageService implements StorageService {
}
save(key: string, obj: any): Promise<any> {
if (obj == null) {
return Promise.resolve();
}
if (obj instanceof Set) {
obj = Array.from(obj);
}