mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Add a null guard for matrix client TimelinePanel.componentWillUnmount
client can be null when unmounting
This commit is contained in:
parent
ab9690d3b0
commit
06133b0467
@ -117,8 +117,12 @@ module.exports = React.createClass({
|
||||
this.unmounted = true;
|
||||
|
||||
dis.unregister(this.dispatcherRef);
|
||||
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
||||
MatrixClientPeg.get().removeListener("Room.receipt", this.onRoomReceipt);
|
||||
|
||||
var client = MatrixClientPeg.get();
|
||||
if (client) {
|
||||
client.removeListener("Room.timeline", this.onRoomTimeline);
|
||||
client.removeListener("Room.receipt", this.onRoomReceipt);
|
||||
}
|
||||
},
|
||||
|
||||
// set off a pagination request.
|
||||
|
Loading…
Reference in New Issue
Block a user