don't assume a member has events associated
This commit is contained in:
parent
8529bc55e3
commit
af77f0206a
1 changed files with 2 additions and 2 deletions
|
@ -166,7 +166,7 @@ export function guessDMRoomTarget(room, me) {
|
|||
for (const user of room.getJoinedMembers()) {
|
||||
if (user.userId == me.userId) continue;
|
||||
|
||||
if (oldestTs === undefined || user.events.member.getTs() < oldestTs) {
|
||||
if (oldestTs === undefined || (user.events.member && user.events.member.getTs() < oldestTs)) {
|
||||
oldestUser = user;
|
||||
oldestTs = user.events.member.getTs();
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ export function guessDMRoomTarget(room, me) {
|
|||
for (const user of room.currentState.getMembers()) {
|
||||
if (user.userId == me.userId) continue;
|
||||
|
||||
if (oldestTs === undefined || user.events.member.getTs() < oldestTs) {
|
||||
if (oldestTs === undefined || (user.events.member && user.events.member.getTs() < oldestTs)) {
|
||||
oldestUser = user;
|
||||
oldestTs = user.events.member.getTs();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue