summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/directory.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index be9f2a21b2..6bcc5a5e2b 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -257,7 +257,8 @@ class DirectoryHandler(BaseHandler):
             room_id, EventTypes.CanonicalAlias, ""
         )
 
-        if alias_event.content.get("alias", "") != room_alias.to_string():
+        alias_str = room_alias.to_string()
+        if not alias_event or alias_event.content.get("alias", "") != alias_str:
             return
 
         msg_handler = self.hs.get_handlers().message_handler