Fix rageshake with no matrix client

We checked for the presence of a matrix client but then went and
called a method on it assuming it existed on the line below, so,
don't do that.

https://github.com/vector-im/riot-web/issues/13624 pointed this out
pull/21833/head
David Baker 2020-05-11 16:21:08 +01:00
parent 159547e6f8
commit f487c2b38c
1 changed files with 7 additions and 7 deletions

View File

@ -101,7 +101,6 @@ export default async function sendBugReport(bugReportEndpoint: string, opts: IOp
if (client) {
body.append('user_id', client.credentials.userId);
body.append('device_id', client.deviceId);
}
if (client.isCryptoEnabled()) {
const keys = [`ed25519:${client.getDeviceEd25519Key()}`];
@ -111,6 +110,7 @@ export default async function sendBugReport(bugReportEndpoint: string, opts: IOp
body.append('device_keys', keys.join(', '));
body.append('cross_signing_key', client.getCrossSigningId());
}
}
if (opts.label) {
body.append('label', opts.label);