Fix crash in room without create state event (#546)
This commit is contained in:
parent
fbe287a702
commit
44553cc375
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ function RoomVisibility({ roomId }) {
|
||||||
|
|
||||||
const noSpaceParent = currentState.getStateEvents('m.space.parent').length === 0;
|
const noSpaceParent = currentState.getStateEvents('m.space.parent').length === 0;
|
||||||
const mCreate = currentState.getStateEvents('m.room.create')[0]?.getContent();
|
const mCreate = currentState.getStateEvents('m.room.create')[0]?.getContent();
|
||||||
const roomVersion = Number(mCreate.room_version);
|
const roomVersion = Number(mCreate?.room_version ?? 0);
|
||||||
|
|
||||||
const myPowerlevel = room.getMember(mx.getUserId())?.powerLevel || 0;
|
const myPowerlevel = room.getMember(mx.getUserId())?.powerLevel || 0;
|
||||||
const canChange = room.currentState.hasSufficientPowerLevelFor('state_default', myPowerlevel);
|
const canChange = room.currentState.hasSufficientPowerLevelFor('state_default', myPowerlevel);
|
||||||
|
|
Loading…
Reference in a new issue