1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-21 02:11:54 +01:00

add null check for cipher when attempting to view

This commit is contained in:
Nick Krantz 2024-10-04 13:12:07 -05:00
parent 87ff20af2c
commit caa3b46f50
No known key found for this signature in database
GPG Key ID: FF670021ABCAB82E

View File

@ -877,6 +877,10 @@ export class VaultComponent implements OnInit, OnDestroy {
/** Opens the view dialog for the given cipher unless password reprompt fails */ /** Opens the view dialog for the given cipher unless password reprompt fails */
async viewCipherById(cipher: CipherView) { async viewCipherById(cipher: CipherView) {
if (!cipher) {
return;
}
if ( if (
cipher && cipher &&
cipher.reprompt !== 0 && cipher.reprompt !== 0 &&
@ -890,7 +894,7 @@ export class VaultComponent implements OnInit, OnDestroy {
const cipherFormConfig = await this.cipherFormConfigService.buildConfig( const cipherFormConfig = await this.cipherFormConfigService.buildConfig(
"edit", "edit",
cipher.id as CipherId, cipher.id as CipherId,
cipher?.type, cipher.type,
); );
await this.openVaultItemDialog("view", cipherFormConfig, cipher); await this.openVaultItemDialog("view", cipherFormConfig, cipher);