Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2118 from matrix-org/erikj/no_devices
Browse files Browse the repository at this point in the history
Fix getting latest device IP for user with no devices
  • Loading branch information
erikjohnston authored Apr 12, 2017
2 parents f3cf3ff + 85657ee commit 7b41013
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/storage/client_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def _get_last_client_ip_by_device_txn(cls, txn, devices, retcols):
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 "
Expand Down

0 comments on commit 7b41013

Please sign in to comment.