Fix MemberInfo handling User objects without crashing

This commit is contained in:
Michael Telatynski 2020-01-29 07:53:23 +00:00
parent 2fbda42374
commit 83fdeeb180

View file

@ -1113,7 +1113,8 @@ export default createReactClass({
} }
} }
const avatarUrl = this.props.member.getMxcAvatarUrl(); const {member} = this.props;
const avatarUrl = member.avatarUrl || (member.getMxcAvatarUrl && member.getMxcAvatarUrl());
let avatarElement; let avatarElement;
if (avatarUrl) { if (avatarUrl) {
const httpUrl = this.context.mxcUrlToHttp(avatarUrl, 800, 800); const httpUrl = this.context.mxcUrlToHttp(avatarUrl, 800, 800);