summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-05 11:07:54 +0000
committerErik Johnston <erik@matrix.org>2014-11-05 11:07:54 +0000
commit96c001e6688617cc365f548a3152a32c647ebc59 (patch)
tree678b86f68ca706a34dd4b73591f549e7f7ca9469 /synapse/state.py
parentPEP8 (diff)
downloadsynapse-96c001e6688617cc365f548a3152a32c647ebc59.tar.xz
Fix auth checks to all use the given old_event_state
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 9771883bc3..32744e047c 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -188,11 +188,15 @@ class StateHandler(object):
             consumeErrors=True
         )
 
-        max_power = max([int(p) for p in new_powers])
+        new_powers = [
+            int(p) if p else 0 for p in new_powers
+        ]
+
+        max_power = max(new_powers)
 
         curr_events = [
             z[0] for z in zip(curr_events, new_powers)
-            if int(z[1]) == max_power
+            if z[1] == max_power
         ]
 
         if not curr_events: