From 8698d40d3ce3ef665c704f6db14399fa635cc0de Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 15 Feb 2017 19:01:00 +0000 Subject: [PATCH] Fix docs & add MatrixClient check Addresses PR feedback without breaking RoomSettings --- src/components/views/rooms/RoomSettings.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 7a9cb2224c..3247f5a90b 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -38,7 +38,7 @@ function parseIntWithDefault(val, def) { const BannedUser = React.createClass({ propTypes: { - member: React.PropTypes.string.isRequired, + member: React.PropTypes.object.isRequired, // js-sdk RoomMember }, _onUnbanClick: function() { @@ -147,7 +147,10 @@ module.exports = React.createClass({ componentWillUnmount: function() { ScalarMessaging.stopListening(); - MatrixClientPeg.get().removeListener("RoomMember.membership", this._onRoomMemberMembership); + const cli = MatrixClientPeg.get(); + if (cli) { + cli.removeListener("RoomMember.membership", this._onRoomMemberMembership); + } dis.dispatch({ action: 'ui_opacity',