From 2dbe03ba11a3db6aded2afcdc8bf53edbdedad4d Mon Sep 17 00:00:00 2001 From: Jacob Fink Date: Wed, 14 Jun 2023 15:15:15 -0400 Subject: [PATCH] add early exit to native messaging flow for errors --- apps/browser/src/background/nativeMessaging.background.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/browser/src/background/nativeMessaging.background.ts b/apps/browser/src/background/nativeMessaging.background.ts index e1b7fdf4231..5ad4f8e630e 100644 --- a/apps/browser/src/background/nativeMessaging.background.ts +++ b/apps/browser/src/background/nativeMessaging.background.ts @@ -359,6 +359,12 @@ export class NativeMessagingBackground { cancelButtonText: null, type: "danger", }); + + // Exit early + if (this.resolver) { + this.resolver(message); + } + return; } // Verify key is correct by attempting to decrypt a secret