[PM-4660] return early from cipher decryption if no encryption key (#6774)
* return early from cipher decryption if no key * add comment
This commit is contained in:
parent
0a7fcddd5a
commit
c8bc7c62e9
|
@ -293,6 +293,10 @@ export class CipherService implements CipherServiceAbstraction {
|
||||||
const ciphers = await this.getAll();
|
const ciphers = await this.getAll();
|
||||||
const orgKeys = await this.cryptoService.getOrgKeys();
|
const orgKeys = await this.cryptoService.getOrgKeys();
|
||||||
const userKey = await this.cryptoService.getUserKeyWithLegacySupport();
|
const userKey = await this.cryptoService.getUserKeyWithLegacySupport();
|
||||||
|
if (orgKeys == null && userKey == null) {
|
||||||
|
// return early if there are no keys to decrypt with
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Group ciphers by orgId or under 'null' for the user's ciphers
|
// Group ciphers by orgId or under 'null' for the user's ciphers
|
||||||
const grouped = ciphers.reduce((agg, c) => {
|
const grouped = ciphers.reduce((agg, c) => {
|
||||||
|
|
Loading…
Reference in New Issue