summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/consent/consent_resource.py2
-rw-r--r--synapse/state/v2.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/consent/consent_resource.py b/synapse/rest/consent/consent_resource.py
index 4cadd71d7e..89b82b0591 100644
--- a/synapse/rest/consent/consent_resource.py
+++ b/synapse/rest/consent/consent_resource.py
@@ -141,7 +141,7 @@ class ConsentResource(Resource):
         username = parse_string(request, "u", required=False, default="")
         userhmac = None
         has_consented = False
-        public_version = username != ""
+        public_version = username == ""
         if not public_version:
             userhmac = parse_string(request, "h", required=True, encoding=None)
 
diff --git a/synapse/state/v2.py b/synapse/state/v2.py
index 5d06f7e928..dbc9688c56 100644
--- a/synapse/state/v2.py
+++ b/synapse/state/v2.py
@@ -53,6 +53,10 @@ def resolve_events_with_store(state_sets, event_map, state_res_store):
 
     logger.debug("Computing conflicted state")
 
+    # We use event_map as a cache, so if its None we need to initialize it
+    if event_map is None:
+        event_map = {}
+
     # First split up the un/conflicted state
     unconflicted_state, conflicted_state = _seperate(state_sets)