diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index 09c01374..71c9140c 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -166,7 +166,7 @@ module.exports = { break; } } - roomIndex = (roomIndex + roomIndexDelta) % allRooms.length; + roomIndex = Math.max((roomIndex + roomIndexDelta) % allRooms.length, 0); this.focusComposer = true; this.setState({ currentRoom: allRooms[roomIndex].roomId