diff --git a/src/createRoom.ts b/src/createRoom.ts index 613fe26c9e7..cbaaddc747d 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -169,7 +169,8 @@ export default async function createRoom(opts: IOpts): Promise { } } - if (opts.joinRule !== JoinRule.Restricted) { + // we handle the restricted join rule in the parentSpace handling block above + if (opts.joinRule && opts.joinRule !== JoinRule.Restricted) { createOpts.initial_state.push({ type: EventType.RoomJoinRules, content: { join_rule: opts.joinRule },