Null guard on componentWillUnmount

This commit is contained in:
Kegan Dougal 2016-12-15 16:13:09 +00:00
parent 8a511ed54b
commit ec41fc284a

View file

@ -108,7 +108,10 @@ module.exports = React.createClass({
middleOpacity: 1.0, middleOpacity: 1.0,
}); });
dis.unregister(this.dispatcherRef); dis.unregister(this.dispatcherRef);
MatrixClientPeg.get().removeListener("RoomMember.membership", this._onInviteStateChange); let cli = MatrixClientPeg.get();
if (cli) {
cli.removeListener("RoomMember.membership", this._onInviteStateChange);
}
}, },
_refreshFromServer: function() { _refreshFromServer: function() {