apply strictnullchecks to src/components/views/beacon/* (#10272)
This commit is contained in:
parent
ffa047be68
commit
de6a1a661c
11 changed files with 48 additions and 30 deletions
|
@ -45,12 +45,12 @@ const DialogOwnBeaconStatus: React.FC<Props> = ({ roomId }) => {
|
|||
const matrixClient = useContext(MatrixClientContext);
|
||||
const room = matrixClient.getRoom(roomId);
|
||||
|
||||
if (!beacon?.isLive) {
|
||||
if (!beacon?.isLive || !room) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isSelfLocation = beacon.beaconInfo.assetType === LocationAssetType.Self;
|
||||
const beaconMember = isSelfLocation ? room.getMember(beacon.beaconInfoOwner) : undefined;
|
||||
const isSelfLocation = beacon.beaconInfo?.assetType === LocationAssetType.Self;
|
||||
const beaconMember = isSelfLocation ? room.getMember(beacon.beaconInfoOwner) : null;
|
||||
|
||||
return (
|
||||
<div className="mx_DialogOwnBeaconStatus">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue