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) {
|
if (fallbackMember) {
|
||||||
return fallbackMember.userId;
|
return fallbackMember.userId;
|
||||||
}
|
}
|
||||||
// now we're getting into sketchy territory,
|
// remember, we're assuming this room is a DM,
|
||||||
// but we're assuming this room is marked as a DM
|
// so returning the first member we find should be fine
|
||||||
// so we're going to make a wild-ish guess with whom
|
const hasHeroes = Array.isArray(this._summaryHeroes) &&
|
||||||
if (this._summaryHeroes.length) {
|
this._summaryHeroes.length;
|
||||||
|
if (hasHeroes) {
|
||||||
return this._summaryHeroes[0];
|
return this._summaryHeroes[0];
|
||||||
}
|
}
|
||||||
const members = this.currentState.getMembers();
|
const members = this.currentState.getMembers();
|
||||||
|
|||||||
Reference in New Issue
Block a user