From 77bbd72c53c006e928802ddd0c2d9d437574299c Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Fri, 13 Jan 2023 15:00:37 +0100 Subject: [PATCH] [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. --- apps/browser/src/content/webauthn/messaging/messenger.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/content/webauthn/messaging/messenger.ts b/apps/browser/src/content/webauthn/messaging/messenger.ts index 3b9f54d5464..9c42d87da5d 100644 --- a/apps/browser/src/content/webauthn/messaging/messenger.ts +++ b/apps/browser/src/content/webauthn/messaging/messenger.ts @@ -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 + ) ) );