1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-23 03:22:50 +02: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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