Conform more code to strict null checking (#10153)

* Conform more code to strict null checking

* Conform more code to strict null checking

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski
2023-02-15 13:36:22 +00:00
committed by GitHub
parent a4ff959aa1
commit 145a5a8a8d
89 changed files with 520 additions and 551 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ import { useEventEmitterState } from "../../hooks/useEventEmitter";
export const useLiveBeacons = (roomId: Room["roomId"], matrixClient: MatrixClient): Beacon[] => {
const room = matrixClient.getRoom(roomId);
const liveBeacons = useEventEmitterState(room.currentState, RoomStateEvent.BeaconLiveness, () =>
room.currentState?.liveBeaconIds.map((beaconIdentifier) => room.currentState.beacons.get(beaconIdentifier)),
const liveBeacons = useEventEmitterState(room?.currentState, RoomStateEvent.BeaconLiveness, () =>
room?.currentState?.liveBeaconIds.map((beaconIdentifier) => room.currentState.beacons.get(beaconIdentifier)),
);
return liveBeacons;