Conform more of the codebase with strictNullChecks
(#10703)
This commit is contained in:
parent
db40479910
commit
619a9e8542
24 changed files with 108 additions and 77 deletions
|
@ -74,10 +74,12 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
|
||||
if (request.isSelfVerification) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const device = await cli.getDevice(request.channel.deviceId);
|
||||
const ip = device.last_seen_ip;
|
||||
const device = request.channel.deviceId ? await cli.getDevice(request.channel.deviceId) : null;
|
||||
const ip = device?.last_seen_ip;
|
||||
this.setState({
|
||||
device: cli.getStoredDevice(cli.getUserId()!, request.channel.deviceId) ?? undefined,
|
||||
device:
|
||||
(request.channel.deviceId && cli.getStoredDevice(cli.getSafeUserId(), request.channel.deviceId)) ||
|
||||
undefined,
|
||||
ip,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue