From 1792fa45f4732aae292f85a85903d1199be87a65 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 8 Jun 2017 15:45:50 +0100 Subject: [PATCH] Null-guard roomId before sending a dispatch to update scroll state Otherwise we pointlessly assign the null key to something --- src/components/structures/RoomView.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index cfa4038114..06e65589d1 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -590,6 +590,10 @@ module.exports = React.createClass({ }, _updateScrollMap(roomId) { + // No point updating scroll state if the room ID hasn't been resolved yet + if (!roomId) { + return; + } dis.dispatch({ action: 'update_scroll_state', room_id: roomId,