You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-13 23:41:50 +03:00
Add a null guard for matrix client TimelinePanel.componentWillUnmount
client can be null when unmounting
This commit is contained in:
@ -117,8 +117,12 @@ module.exports = React.createClass({
|
|||||||
this.unmounted = true;
|
this.unmounted = true;
|
||||||
|
|
||||||
dis.unregister(this.dispatcherRef);
|
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.
|
// set off a pagination request.
|
||||||
|
Reference in New Issue
Block a user