Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix cannot read length of undefined for room upgrades #7037

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/RoomUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ export async function upgradeRoom(
spinnerModal = Modal.createDialog(Spinner, null, "mx_Dialog_spinner");
}

let toInvite: string[];
let toInvite: string[] = [];
if (inviteUsers) {
toInvite = [
...room.getMembersWithMembership("join"),
...room.getMembersWithMembership("invite"),
].map(m => m.userId).filter(m => m !== cli.getUserId());
}

let parentsToRelink: Room[];
let parentsToRelink: Room[] = [];
if (updateSpaces) {
parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId))
.map(roomId => cli.getRoom(roomId))
Expand Down