1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) => {