summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-06-05 16:32:35 +0100
committerRichard van der Hoff <richard@matrix.org>2019-06-05 16:32:35 +0100
commit7603a706eb96305d804da05030a71288fcc255ab (patch)
treed59bcc7827bc6b038d5c3e7bc46677a84007e255 /synapse/handlers/presence.py
parentUpdate sample config (diff)
parentFix `federation_custom_ca_list` configuration option. (diff)
downloadsynapse-7603a706eb96305d804da05030a71288fcc255ab.tar.xz
Merge branch 'rav/fix_custom_ca' into rav/enable_tls_verification
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 6209858bbb..e49c8203ef 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -828,14 +828,17 @@ class PresenceHandler(object):
                 # joins.
                 continue
 
-            event = yield self.store.get_event(event_id)
-            if event.content.get("membership") != Membership.JOIN:
+            event = yield self.store.get_event(event_id, allow_none=True)
+            if not event or event.content.get("membership") != Membership.JOIN:
                 # We only care about joins
                 continue
 
             if prev_event_id:
-                prev_event = yield self.store.get_event(prev_event_id)
-                if prev_event.content.get("membership") == Membership.JOIN:
+                prev_event = yield self.store.get_event(prev_event_id, allow_none=True)
+                if (
+                    prev_event
+                    and prev_event.content.get("membership") == Membership.JOIN
+                ):
                     # Ignore changes to join events.
                     continue