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:
@@ -718,12 +718,12 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);
|
const result: ViewCipherDialogCloseResult = await lastValueFrom(dialogRef.closed);
|
||||||
|
|
||||||
// If the dialog was closed by deleting the cipher, refresh the vault.
|
// If the dialog was closed by deleting the cipher, refresh the vault.
|
||||||
if (result.action === ViewCipherDialogResult.deleted) {
|
if (result?.action === ViewCipherDialogResult.deleted) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the dialog was closed by any other action (close button, escape key, etc), navigate back to the vault.
|
// 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 });
|
this.go({ cipherId: null, itemId: null, action: null });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user