summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-10-30 11:01:07 +0000
committerDavid Baker <dave@matrix.org>2018-10-30 11:01:07 +0000
commit12941f5f8b1f38f273e301104203149b10e9e214 (patch)
tree19f135931baaf14d4917542d8cce23cc9434e74f /synapse/storage
parentConvert version back to a string (diff)
downloadsynapse-12941f5f8b1f38f273e301104203149b10e9e214.tar.xz
Cast bacjup version to int when querying
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/e2e_room_keys.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/e2e_room_keys.py b/synapse/storage/e2e_room_keys.py
index 9f826b292c..2a012e9487 100644
--- a/synapse/storage/e2e_room_keys.py
+++ b/synapse/storage/e2e_room_keys.py
@@ -219,7 +219,12 @@ class EndToEndRoomKeyStore(SQLBaseStore):
             if version is None:
                 this_version = self._get_current_version(txn, user_id)
             else:
-                this_version = version
+                try:
+                    this_version = int(version)
+                except ValueError:
+                    # Our versions are all ints so if we can't convert it to an integer,
+                    # it isn't there.
+                    raise StoreError(404, "No row found")
 
             result = self._simple_select_one_txn(
                 txn,