1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

[EC-598] fix: messenger crashing

The messenger is listening to all DOM communcation, most of which is formatted differently. We were not handling these cases properly which resulted in attempts to access undefined fields.
This commit is contained in:
Andreas Coroiu
2023-01-13 15:00:37 +01:00
parent e41c849c18
commit 77bbd72c53

View File

@@ -40,7 +40,9 @@ export class Messenger {
const promise = firstValueFrom(
this.channel.messages$.pipe(
filter((m) => m.metadata.requestId === requestId && m.type !== request.type)
filter(
(m) => m != undefined && m.metadata?.requestId === requestId && m.type !== request.type
)
)
);