Conform more of the codebase to strictNullChecks (#10504
* Conform more of the codebase to `strictNullChecks` * Iterate
This commit is contained in:
committed by
GitHub
parent
6db0c7a1a6
commit
bc60a9b594
@@ -28,7 +28,7 @@ export const useBeacon = (beaconInfoEvent: MatrixEvent): Beacon | undefined => {
|
||||
const roomId = beaconInfoEvent.getRoomId();
|
||||
const beaconIdentifier = getBeaconInfoIdentifier(beaconInfoEvent);
|
||||
|
||||
const room = matrixClient.getRoom(roomId);
|
||||
const room = matrixClient?.getRoom(roomId);
|
||||
const beaconInstance = room?.currentState.beacons.get(beaconIdentifier);
|
||||
|
||||
// TODO could this be less stupid?
|
||||
|
||||
@@ -475,8 +475,8 @@ function isHostnameIpAddress(hostname: string): boolean {
|
||||
return isIp(hostname);
|
||||
}
|
||||
|
||||
export const calculateRoomVia = (room: Room): string[] | undefined => {
|
||||
export const calculateRoomVia = (room: Room): string[] => {
|
||||
const permalinkCreator = new RoomPermalinkCreator(room);
|
||||
permalinkCreator.load();
|
||||
return permalinkCreator.serverCandidates;
|
||||
return permalinkCreator.serverCandidates ?? [];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user