summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorKrombel <krombel@krombel.de>2017-05-15 18:36:37 +0200
committerKrombel <krombel@krombel.de>2017-05-15 18:36:37 +0200
commit64953c8ed235b38a31f7b2909493e63267bd2cfd (patch)
tree13634ad7513a584ad68b5adaa058b04204899fdd /synapse/storage
parentinsert whitespace to fix travis build (diff)
downloadsynapse-64953c8ed235b38a31f7b2909493e63267bd2cfd.tar.xz
avoid access-error if no filter_id matches
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/filtering.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/filtering.py b/synapse/storage/filtering.py
index 9101f57288..73f7a078fa 100644
--- a/synapse/storage/filtering.py
+++ b/synapse/storage/filtering.py
@@ -56,9 +56,9 @@ class FilteringStore(SQLBaseStore):
                 "WHERE user_id = ? AND filter_json = ?"
             )
             txn.execute(sql, (user_localpart, def_json))
-            filter_id = txn.fetchone()[0]
-            if filter_id is not None:
-                return filter_id
+            filter_id_response = txn.fetchone()
+            if filter_id_response is not None:
+                return filter_id_response[0]
 
             sql = (
                 "SELECT MAX(filter_id) FROM user_filters "