summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
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: