From e3afbb157da2ad494b0910ec5660ca601b0bc3fd Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 23 Aug 2018 12:05:09 +0100 Subject: [PATCH] Don't crash if the value of a room tag is null We were checking that the order was not null, but not the object itself. --- src/stores/RoomListStore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index 5b38792678..4cc4e048df 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -284,8 +284,8 @@ class RoomListStore extends Store { if (optimisticRequest && roomB === optimisticRequest.room) metaB = optimisticRequest.metaData; // Make sure the room tag has an order element, if not set it to be the bottom - const a = metaA.order; - const b = metaB.order; + const a = metaA ? metaA.order : undefined; + const b = metaB ? metaB.order : undefined; // Order undefined room tag orders to the bottom if (a === undefined && b !== undefined) {