Skip to content

Commit 62f9f17

Browse files
committed
oopsie, this should also trigger when type isn't provided
1 parent 0ef4dd9 commit 62f9f17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models/PolicyList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class PolicyList extends EventEmitter {
162162
};
163163
// Guard room type in case someone overwrites it when declaring custom creation_content in future code.
164164
const roomType = finalRoomCreateOptions.creation_content?.type;
165-
if (typeof roomType === 'string' && !PolicyList.ROOM_TYPE_VARIANTS.includes(roomType)) {
165+
if (typeof roomType !== 'string' || !PolicyList.ROOM_TYPE_VARIANTS.includes(roomType)) {
166166
throw new TypeError(`Creating a policy room with a type other than the policy room type is not supported, you probably don't want to do this.`);
167167
}
168168
const listRoomId = await client.createRoom(finalRoomCreateOptions);

0 commit comments

Comments
 (0)