Avoid soft crash if unknown device in verification

Rageshakes from the wild indicate that device was null here which
implies that we somehow did not know about the device when verifiying
it? Log and null-check to avoid a soft crash.
This commit is contained in:
David Baker 2020-05-12 11:05:30 +01:00
parent 03fce86699
commit 5c0920da42
3 changed files with 30 additions and 14 deletions

View file

@ -45,9 +45,6 @@ const EncryptionPanel = (props) => {
}
}, [verificationRequest]);
const deviceId = request && request.channel.deviceId;
const device = MatrixClientPeg.get().getStoredDevice(MatrixClientPeg.get().getUserId(), deviceId);
useEffect(() => {
async function awaitPromise() {
setRequesting(true);
@ -143,7 +140,7 @@ const EncryptionPanel = (props) => {
key={request.channel.transactionId}
inDialog={layout === "dialog"}
phase={phase}
device={device} />
/>
</React.Fragment>);
}
};