1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

Check result is not null or undefined before trying to access the action property. (#10754)

This commit is contained in:
Alec Rippberger
2024-08-29 17:09:20 -05:00
committed by GitHub
parent c1870a37c7
commit 1c43402601

View File

@@ -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 });
}
}