From ffb6054eac49f09e4288ca019e399c6becb7b293 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Thu, 31 Oct 2019 11:21:58 +0000
Subject: [PATCH] Attempt to fix soft crash on some pinned events by null
guarding member
---
src/components/views/rooms/PinnedEventTile.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/components/views/rooms/PinnedEventTile.js b/src/components/views/rooms/PinnedEventTile.js
index cc086f66daf..1279c010496 100644
--- a/src/components/views/rooms/PinnedEventTile.js
+++ b/src/components/views/rooms/PinnedEventTile.js
@@ -61,7 +61,9 @@ module.exports = createReactClass({
return this.props.mxRoom.currentState.mayClientSendStateEvent('m.room.pinned_events', MatrixClientPeg.get());
},
render: function() {
- const sender = this.props.mxRoom.getMember(this.props.mxEvent.getSender());
+ const sender = this.props.mxEvent.getSender();
+ // Get the latest sender profile rather than historical
+ const senderProfile = this.props.mxRoom.getMember(sender);
const avatarSize = 40;
let unpinButton = null;
@@ -83,10 +85,10 @@ module.exports = createReactClass({
-
+
- { sender.name }
+ { senderProfile ? senderProfile.name : sender }
{ formatFullDate(new Date(this.props.mxEvent.getTs())) }