apply strictnullchecks to src/components/views/beacon/* (#10272)

This commit is contained in:
Kerry 2023-03-02 22:58:05 +13:00 committed by GitHub
parent ffa047be68
commit de6a1a661c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 48 additions and 30 deletions

View file

@ -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">