You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
check heroes is not falsy first, this would fail without LL
This commit is contained in:
@@ -303,10 +303,11 @@ Room.prototype.guessDMUserId = function() {
|
||||
if (fallbackMember) {
|
||||
return fallbackMember.userId;
|
||||
}
|
||||
// now we're getting into sketchy territory,
|
||||
// but we're assuming this room is marked as a DM
|
||||
// so we're going to make a wild-ish guess with whom
|
||||
if (this._summaryHeroes.length) {
|
||||
// remember, we're assuming this room is a DM,
|
||||
// so returning the first member we find should be fine
|
||||
const hasHeroes = Array.isArray(this._summaryHeroes) &&
|
||||
this._summaryHeroes.length;
|
||||
if (hasHeroes) {
|
||||
return this._summaryHeroes[0];
|
||||
}
|
||||
const members = this.currentState.getMembers();
|
||||
|
||||
Reference in New Issue
Block a user