summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2019-01-22 16:52:29 +0000
committerNeil Johnson <neil@matrix.org>2019-01-22 16:52:29 +0000
commitd619b113edf2942185a502a91cbf5b51642f6814 (patch)
tree974689abd0c86e184934a8668d08bb59c19dabd2 /synapse/config
parentMerge pull request #4423 from matrix-org/neilj/disable_msisdn_on_registration (diff)
downloadsynapse-d619b113edf2942185a502a91cbf5b51642f6814.tar.xz
Fix None guard in config.server.is_threepid_reserved
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/server.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index fb57791098..927c54ee5b 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -420,19 +420,20 @@ class ServerConfig(Config):
                                   " service on the given port.")
 
 
-def is_threepid_reserved(config, threepid):
+def is_threepid_reserved(reserved_threepids, threepid):
     """Check the threepid against the reserved threepid config
     Args:
-        config(ServerConfig) - to access server config attributes
+        reserved_threepids([dict]) - list of reserved threepids
         threepid(dict) - The threepid to test for
 
     Returns:
         boolean Is the threepid undertest reserved_user
     """
+    if not threepid:
+        return False
 
-    for tp in config.mau_limits_reserved_threepids:
-        if (threepid['medium'] == tp['medium']
-                and threepid['address'] == tp['address']):
+    for tp in reserved_threepids:
+        if (threepid['medium'] == tp['medium'] and threepid['address'] == tp['address']):
             return True
     return False