From 39e61c4fa3a8ae87406d2f1e2885e177a8af75ec Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Oct 2021 10:21:27 +0100 Subject: [PATCH] Fix cannot read length of undefined for room upgrades (#7037) --- src/utils/RoomUpgrade.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/RoomUpgrade.ts b/src/utils/RoomUpgrade.ts index f2ac4aea4e..ba3fb08c9e 100644 --- a/src/utils/RoomUpgrade.ts +++ b/src/utils/RoomUpgrade.ts @@ -50,7 +50,7 @@ export async function upgradeRoom( spinnerModal = Modal.createDialog(Spinner, null, "mx_Dialog_spinner"); } - let toInvite: string[]; + let toInvite: string[] = []; if (inviteUsers) { toInvite = [ ...room.getMembersWithMembership("join"), @@ -58,7 +58,7 @@ export async function upgradeRoom( ].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))