Fix cannot read length of undefined for room upgrades (#7037)

pull/21833/head
Michael Telatynski 2021-10-26 10:21:27 +01:00 committed by GitHub
parent 0fa9638681
commit 39e61c4fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ export async function upgradeRoom(
spinnerModal = Modal.createDialog(Spinner, null, "mx_Dialog_spinner"); spinnerModal = Modal.createDialog(Spinner, null, "mx_Dialog_spinner");
} }
let toInvite: string[]; let toInvite: string[] = [];
if (inviteUsers) { if (inviteUsers) {
toInvite = [ toInvite = [
...room.getMembersWithMembership("join"), ...room.getMembersWithMembership("join"),
@ -58,7 +58,7 @@ export async function upgradeRoom(
].map(m => m.userId).filter(m => m !== cli.getUserId()); ].map(m => m.userId).filter(m => m !== cli.getUserId());
} }
let parentsToRelink: Room[]; let parentsToRelink: Room[] = [];
if (updateSpaces) { if (updateSpaces) {
parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId)) parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId))
.map(roomId => cli.getRoom(roomId)) .map(roomId => cli.getRoom(roomId))