Check result is not null or undefined before trying to access the action property. (#10754)
This commit is contained in:
parent
c1870a37c7
commit
1c43402601
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue