diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 0ddbd06b4f..4f20b354d3 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -730,8 +730,19 @@ module.exports = React.createClass({ if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) { return; } + if (!MatrixClientPeg.get().isCryptoEnabled()) { + // If crypto is not currently enabled, we aren't tracking devices at all, + // so we don't know what the answer is. Let's error on the safe side and show + // a warning for this case. + this.setState({ + e2eStatus: "warning", + }); + return; + } room.hasUnverifiedDevices().then((hasUnverifiedDevices) => { - this.setState({e2eStatus: hasUnverifiedDevices ? "warning" : "verified"}); + this.setState({ + e2eStatus: hasUnverifiedDevices ? "warning" : "verified", + }); }); },