summary refs log tree commit diff
path: root/synapse/storage/e2e_room_keys.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/e2e_room_keys.py')
-rw-r--r--synapse/storage/e2e_room_keys.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/e2e_room_keys.py b/synapse/storage/e2e_room_keys.py
index b51faa1204..7ab75070a2 100644
--- a/synapse/storage/e2e_room_keys.py
+++ b/synapse/storage/e2e_room_keys.py
@@ -202,13 +202,15 @@ class EndToEndRoomKeyStore(SQLBaseStore):
                     "SELECT MAX(version) FROM e2e_room_keys_versions WHERE user_id=?",
                     (user_id,)
                 )
-                version = txn.fetchone()[0]
+                this_version = txn.fetchone()[0]
+            else:
+                this_version = version
 
             return self._simple_select_one_txn(
                 table="e2e_room_keys_versions",
                 keyvalues={
                     "user_id": user_id,
-                    "version": version,
+                    "version": this_version,
                 },
                 retcols=(
                     "user_id",