nullguard SenderProfile,broke when NotifPanel had evs from forgotten rooms

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-06-23 01:22:38 +01:00
parent aff2cc9065
commit 807d72f2d9
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E

View file

@ -72,14 +72,12 @@ export default React.createClass({
_updateRelatedGroups() { _updateRelatedGroups() {
if (this.unmounted) return; if (this.unmounted) return;
const relatedGroupsEvent = this.context.matrixClient const room = this.context.matrixClient.getRoom(this.props.mxEvent.getRoomId())
.getRoom(this.props.mxEvent.getRoomId()) if (!room) return;
.currentState
.getStateEvents('m.room.related_groups', ''); const relatedGroupsEvent = room.currentState.getStateEvents('m.room.related_groups', '');
this.setState({ this.setState({
relatedGroups: relatedGroupsEvent ? relatedGroups: relatedGroupsEvent ? relatedGroupsEvent.getContent().groups || [] : [],
relatedGroupsEvent.getContent().groups || []
: [],
}); });
}, },