From 8ffe14881e94b0b7b8fc05ce2a650cc8f2c425cf Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 5 Dec 2016 18:33:38 +0000 Subject: [PATCH] Don't throw an exception entering settings page if end to end encryption is disabled (eg. if you're a guest and the server is too old to support e2e for guests). --- src/components/structures/UserSettings.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index b82f2f5958..c15f58013e 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -338,7 +338,16 @@ module.exports = React.createClass({ }, _renderCryptoInfo: function() { - var client = MatrixClientPeg.get(); + const client = MatrixClientPeg.get(); + if (!client.isCryptoEnabled()) { + return
+

Cryptography

+
+ End-to-end encryption is disabled +
+
; + } + var deviceId = client.deviceId; var identityKey = client.getDeviceEd25519Key() || "";