don't trip over missing create events when loading power levels
as the test from previous commit fails because of that, and powerlevels works fine without
This commit is contained in:
parent
4a8a6168cd
commit
84ecaa2ee1
1 changed files with 8 additions and 4 deletions
|
@ -84,10 +84,14 @@ export class Timeline {
|
|||
});
|
||||
}
|
||||
const createState = await txn.roomState.get(this._roomId, "m.room.create", "");
|
||||
return new PowerLevels({
|
||||
createEvent: createState.event,
|
||||
ownUserId: this._ownMember.userId
|
||||
});
|
||||
if (createState) {
|
||||
return new PowerLevels({
|
||||
createEvent: createState.event,
|
||||
ownUserId: this._ownMember.userId
|
||||
});
|
||||
} else {
|
||||
return new PowerLevels({ownUserId: this._ownMember.userId});
|
||||
}
|
||||
}
|
||||
|
||||
_setupEntries(timelineEntries) {
|
||||
|
|
Reference in a new issue