diff --git a/src/Avatar.js b/src/Avatar.js index 2f83ebd9..8de29f1d 100644 --- a/src/Avatar.js +++ b/src/Avatar.js @@ -27,7 +27,10 @@ module.exports = { resizeMethod ); if (!url) { - url = this.defaultAvatarUrlForString(member.userId); + // member can be null here currently since on invites, the JS SDK + // does not have enough info to build a RoomMember object for + // the inviter. + url = this.defaultAvatarUrlForString(member ? member.userId : ''); } return url; },