From caa3b46f50089240cbac854f82f4e06e5e6d6e9c Mon Sep 17 00:00:00 2001 From: Nick Krantz Date: Fri, 4 Oct 2024 13:12:07 -0500 Subject: [PATCH] add null check for cipher when attempting to view --- apps/web/src/app/vault/org-vault/vault.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index d16c3846740..c9c76f5c587 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -877,6 +877,10 @@ export class VaultComponent implements OnInit, OnDestroy { /** Opens the view dialog for the given cipher unless password reprompt fails */ async viewCipherById(cipher: CipherView) { + if (!cipher) { + return; + } + if ( cipher && cipher.reprompt !== 0 && @@ -890,7 +894,7 @@ export class VaultComponent implements OnInit, OnDestroy { const cipherFormConfig = await this.cipherFormConfigService.buildConfig( "edit", cipher.id as CipherId, - cipher?.type, + cipher.type, ); await this.openVaultItemDialog("view", cipherFormConfig, cipher);