From fcf17adf14ed93de6b6d779a3553b27e008dd549 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 4 Mar 2016 16:57:20 +0000 Subject: [PATCH] hopefully fix bug186 by ensuring room members never have null users --- src/components/views/rooms/MemberList.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index e5807f1b50..83e7a0504b 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -246,6 +246,13 @@ module.exports = React.createClass({ // XXX: evil hack until SYJS-28 is fixed Object.keys(all_members).map(function(userId) { + // work around a race where you might have a room member object + // before the user object exists. This may or may not cause + // https://github.com/vector-im/vector-web/issues/186 + if (all_members[userId].user === null) { + all_members[userId].user = MatrixClientPeg.get().getUser(userId); + } + if (all_members[userId].user && !all_members[userId].user.lastPresenceTs) { all_members[userId].user.lastPresenceTs = Date.now(); }