From a58257160ae6427ee7c8f56a41b9e5b540d6b0b4 Mon Sep 17 00:00:00 2001 From: Krzysztof Jan Modras Date: Mon, 12 Apr 2021 16:10:32 +0200 Subject: [PATCH] Extenal API getUser edge case handling In case user is not logged in - the API was not sending a response as the `getUser` promise was rejecting. --- src/background.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index 20175c3be..1cf854092 100644 --- a/src/background.js +++ b/src/background.js @@ -1423,7 +1423,9 @@ function initializeEventListeners() { } if (recognized && request.name === 'getUser') { - account.getUser().then(sendResponse); + account.getUser() + .then(sendResponse) + .catch(() => sendResponse(null)); return true; }