Skip to content

Commit

Permalink
Check result is not null or undefined before trying to access the act…
Browse files Browse the repository at this point in the history
…ion property. (#10754)
  • Loading branch information
alec-livefront authored Aug 29, 2024
1 parent c1870a3 commit 1c43402
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/app/vault/individual-vault/vault.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,12 @@ export class VaultComponent implements OnInit, OnDestroy {
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);

// If the dialog was closed by deleting the cipher, refresh the vault.
if (result.action === ViewCipherDialogResult.deleted) {
if (result?.action === ViewCipherDialogResult.deleted) {
this.refresh();
}

// If the dialog was closed by any other action (close button, escape key, etc), navigate back to the vault.
if (!result.action) {
if (!result?.action) {
this.go({ cipherId: null, itemId: null, action: null });
}
}
Expand Down

0 comments on commit 1c43402

Please sign in to comment.