1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-27 04:21:52 +03:00

Add some null checks

This commit is contained in:
David Baker
2017-12-05 11:14:55 +00:00
parent 4f58b92a14
commit c23a3fd7fe
2 changed files with 5 additions and 3 deletions

View File

@ -53,8 +53,10 @@ export default class UserProvider extends AutocompleteProvider {
}
destroy() {
MatrixClientPeg.get().removeListener("Room.timeline", this._onRoomTimelineBound);
MatrixClientPeg.get().removeListener("RoomState.members", this._onRoomStateMemberBound);
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().removeListener("Room.timeline", this._onRoomTimelineBound);
MatrixClientPeg.get().removeListener("RoomState.members", this._onRoomStateMemberBound);
}
}
_onRoomTimeline(ev, room, toStartOfTimeline, removed, data) {