summary refs log tree commit diff
path: root/synapse/storage/client_ips.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-04-12 10:14:32 +0100
committerGitHub <noreply@github.com>2017-04-12 10:14:32 +0100
commit7b41013102e1a7c322ec8e3502eebe53a1ddb180 (patch)
tree516aedb292a07c06015427e91fa5ef53be6fa35b /synapse/storage/client_ips.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
parentBail on where clause instead (diff)
downloadsynapse-7b41013102e1a7c322ec8e3502eebe53a1ddb180.tar.xz
Merge pull request #2118 from matrix-org/erikj/no_devices
Fix getting latest device IP for user with no devices
Diffstat (limited to 'synapse/storage/client_ips.py')
-rw-r--r--synapse/storage/client_ips.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/client_ips.py b/synapse/storage/client_ips.py
index 71e5ea112f..b01f0046e9 100644
--- a/synapse/storage/client_ips.py
+++ b/synapse/storage/client_ips.py
@@ -120,6 +120,9 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
                 where_clauses.append("(user_id = ? AND device_id = ?)")
                 bindings.extend((user_id, device_id))
 
+        if not where_clauses:
+            return []
+
         inner_select = (
             "SELECT MAX(last_seen) mls, user_id, device_id FROM user_ips "
             "WHERE %(where)s "