From 102faceb2b1a27eda5cdbd1dbf3c1b2fd29e2e4b Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 2 Aug 2018 15:44:30 -0400 Subject: [PATCH] Wrap set credentials for the keychain in a try/catch (#1962) * Wrap set credentials for the keychain in a try/catch * Only wrap the setGenericPassword method --- app/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/app.js b/app/app.js index 1096ec779..47ccfa556 100644 --- a/app/app.js +++ b/app/app.js @@ -161,6 +161,7 @@ export default class App { if (!currentUserId) { return; } + const username = `${deviceToken}, ${currentUserId}`; const password = `${token},${url}`; @@ -172,7 +173,11 @@ export default class App { // Only save to keychain if the url and token are set if (url && token) { - setGenericPassword(username, password); + try { + setGenericPassword(username, password); + } catch (e) { + console.warn('could not set credentials', e); //eslint-disable-line no-console + } } };