From b296d05b350ad4d4a915e983e2a95630d4e12d79 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 20 Jan 2016 15:38:34 +0000 Subject: [PATCH] Fix finally NPE --- src/components/structures/RoomView.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 951a9a5ec1..e2a9f8b730 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -118,15 +118,11 @@ module.exports = React.createClass({ if (!this.state.room) { if (this.props.autoPeek) { console.log("Attempting to peek into room %s", this.props.roomId); - MatrixClientPeg.get().peekInRoom(this.props.roomId).done(() => { - // we don't need to do anything - JS SDK will emit Room events - // which will update the UI. We *do* however need to know if we - // can join the room so we can fiddle with the UI appropriately. - - // ...XXX: or do we? can't we just do them onNewRoom? - }, function(err) { + MatrixClientPeg.get().peekInRoom(this.props.roomId).catch((err) => { console.error("Failed to peek into room: %s", err); }).finally(() => { + // we don't need to do anything - JS SDK will emit Room events + // which will update the UI. this.setState({ autoPeekDone: true });