From 4db16faac00f6318dbc1f6d9ea179c6d4faa05bb Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 20 Dec 2019 14:26:34 +0100 Subject: [PATCH 1/2] Catch href decryption errors --- www/common/userObject.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/www/common/userObject.js b/www/common/userObject.js index 7ac1bfe88..db8e687d3 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -43,10 +43,20 @@ define([ var c = Crypto.createEncryptor(key); cryptor.encrypt = function (href) { // Never encrypt blob href, they are always read-only - if (href.slice(0,7) === '/file/#') { return href; } - return c.encrypt(href); + try { + if (href.slice(0,7) === '/file/#') { return href; } + return c.encrypt(href); + } catch (e) { + return; + } + }; + cryptor.decrypt = function (msg) { + try { + return c.decrypt(msg); + } catch (e) { + return; + } }; - cryptor.decrypt = c.decrypt; } catch (e) { console.error(e); } From a461733aa1c3015d8146bf2e916f8d7078120e0a Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 20 Dec 2019 14:33:28 +0100 Subject: [PATCH 2/2] Fix team invitation with no contact --- www/common/common-ui-elements.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 92f47648b..331c15fd9 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1552,9 +1552,6 @@ define([ var common = config.common; var hasFriends = Object.keys(config.friends || {}).length !== 0; - if (!hasFriends) { - return void UI.alert(Messages.team_noFriend); - } var privateData = common.getMetadataMgr().getPrivateData(); var team = privateData.teams[config.teamId]; if (!team) { return void UI.warn(Messages.error); }