Browse Source

[PM-4660] Check size of orgKeys map instead of against null (#6776)

* Check size of orgKeys map for nullness

* Add null check on orgKeys
pull/6777/head
Robyn MacCallum 2 years ago committed by GitHub
parent
commit
90e2779fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      libs/common/src/vault/services/cipher.service.ts

2
libs/common/src/vault/services/cipher.service.ts

@ -293,7 +293,7 @@ export class CipherService implements CipherServiceAbstraction { @@ -293,7 +293,7 @@ export class CipherService implements CipherServiceAbstraction {
const ciphers = await this.getAll();
const orgKeys = await this.cryptoService.getOrgKeys();
const userKey = await this.cryptoService.getUserKeyWithLegacySupport();
if (orgKeys == null && userKey == null) {
if (orgKeys?.size === 0 && userKey == null) {
// return early if there are no keys to decrypt with
return;
}

Loading…
Cancel
Save