summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-05-23 22:54:56 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-05-23 22:54:56 +0100
commitcb8a321bdd35278fc1214d2dd2c1a8163ce25871 (patch)
tree8cc3eb1c752d252d4313e1ad3983c3fd2dc5c743
parentfix debug text (diff)
downloadsynapse-cb8a321bdd35278fc1214d2dd2c1a8163ce25871.tar.xz
fix NPE in room ordering
Diffstat (limited to '')
-rw-r--r--synapse/push/mailer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index 766888ca79..d8a0c35c79 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -135,8 +135,8 @@ class Mailer(object):
         yield concurrently_execute(_fetch_room_state, rooms_in_order, 3)
 
         # actually sort our so-called rooms_in_order list, most recent room first
-        rooms_in_order = rooms_in_order.sort(
-            key=lambda r: -notifs_by_room[r]['received_ts']
+        rooms_in_order.sort(
+            key=lambda r: -(notifs_by_room[r][-1]['received_ts'] or 0)
         )
 
         rooms = []