1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[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:
Jake Fink
2023-11-02 18:17:47 -04:00
committed by GitHub
parent 0a7fcddd5a
commit c8bc7c62e9

View File

@@ -293,6 +293,10 @@ 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) {
// return early if there are no keys to decrypt with
return;
}
// Group ciphers by orgId or under 'null' for the user's ciphers
const grouped = ciphers.reduce((agg, c) => {