Fix key backup status when missing device

We might not have the device in `sig.device`, so we have to check for it's
existence first. This fixes the "Unable to load key backup status" message that
is incorrectly triggering.

Fixes https://github.com/vector-im/riot-web/issues/9442
pull/21833/head
J. Ryan Stinnett 2019-04-12 16:23:54 +01:00
parent 86a6037a12
commit 5ee9de04c3
1 changed files with 4 additions and 1 deletions

View File

@ -221,7 +221,10 @@ export default class KeyBackupPanel extends React.PureComponent {
{sub}
</span>;
const device = sub => <span className="mx_KeyBackupPanel_deviceName">{deviceName}</span>;
const fromThisDevice = sig.device.getFingerprint() === MatrixClientPeg.get().getDeviceEd25519Key();
const fromThisDevice = (
sig.device &&
sig.device.getFingerprint() === MatrixClientPeg.get().getDeviceEd25519Key()
);
let sigStatus;
if (!sig.device) {
sigStatus = _t(