mirror of https://github.com/vector-im/riot-web
guard against m.room.aliases events with no keys (redaction?)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
ebfdd7c718
commit
d1a24ac87b
|
@ -58,8 +58,8 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
state.domainToAliases = this.aliasEventsToDictionary(aliasEvents);
|
state.domainToAliases = this.aliasEventsToDictionary(aliasEvents);
|
||||||
|
|
||||||
state.remoteDomains = Object.keys(state.domainToAliases).filter((alias) => {
|
state.remoteDomains = Object.keys(state.domainToAliases).filter((domain) => {
|
||||||
return alias !== localDomain;
|
return domain !== localDomain && state.domainToAliases[domain].length > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (canonicalAliasEvent) {
|
if (canonicalAliasEvent) {
|
||||||
|
|
|
@ -774,7 +774,8 @@ module.exports = React.createClass({
|
||||||
const aliasEvents = this.props.room.currentState.getStateEvents('m.room.aliases') || [];
|
const aliasEvents = this.props.room.currentState.getStateEvents('m.room.aliases') || [];
|
||||||
let aliasCount = 0;
|
let aliasCount = 0;
|
||||||
aliasEvents.forEach((event) => {
|
aliasEvents.forEach((event) => {
|
||||||
aliasCount += event.getContent().aliases.length;
|
const aliases = event.getContent().aliases || [];
|
||||||
|
aliasCount += aliases.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.state.join_rule === "public" && aliasCount == 0) {
|
if (this.state.join_rule === "public" && aliasCount == 0) {
|
||||||
|
|
Loading…
Reference in New Issue