summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-09-09 15:07:04 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-09-09 15:07:04 +0100
commited44c475d832196957715f49215a95be1ce1eade (patch)
treee039f94d37b9124d599478dc8d40a1236871cba7 /synapse/handlers
parentMinor fixes from PR comments (diff)
downloadsynapse-ed44c475d832196957715f49215a95be1ce1eade.tar.xz
Reject malformed 3PE query metadata results earlier in AS API handling code
Diffstat (limited to '')
-rw-r--r--synapse/handlers/appservice.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index 4648e78d47..88fa0bb2e4 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -186,17 +186,13 @@ class ApplicationServicesHandler(object):
                 if only_protocol is not None and p != only_protocol:
                     continue
 
-                info = yield self.appservice_api.get_3pe_protocol(s, p)
-
-                # Ignore any result that doesn't contain an "instances" list
-                if "instances" not in info:
-                    continue
-                if not isinstance(info["instances"], list):
-                    continue
-
                 if p not in protocols:
                     protocols[p] = []
-                protocols[p].append(info)
+
+                info = yield self.appservice_api.get_3pe_protocol(s, p)
+
+                if info is not None:
+                    protocols[p].append(info)
 
         def _merge_instances(infos):
             if not infos: