summary refs log tree commit diff
diff options
context:
space:
mode:
authorKatie Wolfe <katie@dnaf.moe>2019-04-24 12:04:16 -0400
committerKatie Wolfe <katie@dnaf.moe>2019-04-24 12:26:55 -0400
commitb3e5db402dd96271b5a81d7f4c3191c48ac81e6c (patch)
treec1c8f57de6d9b0f8eb5d70776b06e3af917093db
parentShow heroes if room name or canonical alias are empty (diff)
downloadsynapse-b3e5db402dd96271b5a81d7f4c3191c48ac81e6c.tar.xz
Clean up code
Signed-off-by: Katie Wolfe <katie@dnaf.moe>
-rw-r--r--synapse/handlers/sync.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index b3e6be6dd2..9f93a7f2da 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -587,14 +587,15 @@ class SyncHandler(object):
         # for the "name" value and default to an empty string.
         if name_id:
             name = yield self.store.get_event(name_id, allow_none=True)
-            if name and name.content and "name" in name.content and name.content.get("name", ""):
+            if name and name.content and name.content.get("name", ""):
                 defer.returnValue(summary)
 
         if canonical_alias_id:
             canonical_alias = yield self.store.get_event(
                 canonical_alias_id, allow_none=True,
             )
-            if canonical_alias and canonical_alias.content and canonical_alias.content.get("alias", ""):
+            if (canonical_alias and canonical_alias.content
+                and canonical_alias.content.get("alias", "")):
                 defer.returnValue(summary)
 
         joined_user_ids = [