summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorCarl Bordum Hansen <carl@bordum.dk>2022-05-25 11:14:45 +0200
committerGitHub <noreply@github.com>2022-05-25 09:14:45 +0000
commit774ac4930dbb0e6f2f6dad4b9eb4630154e1e161 (patch)
tree547c91a2c6ea88a7377db94e1c325ee648636233 /synapse/handlers
parentFix typos in documentation (#12863) (diff)
downloadsynapse-774ac4930dbb0e6f2f6dad4b9eb4630154e1e161.tar.xz
Make sure `prev_ids` defaults to empty list (#12829)
Signed-off-by: Carl Bordum Hansen <carl@bordum.dk>
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/device.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 1d6d1f8a92..e59937fd75 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -763,6 +763,10 @@ class DeviceListUpdater:
         device_id = edu_content.pop("device_id")
         stream_id = str(edu_content.pop("stream_id"))  # They may come as ints
         prev_ids = edu_content.pop("prev_id", [])
+        if not isinstance(prev_ids, list):
+            raise SynapseError(
+                400, "Device list update had an invalid 'prev_ids' field"
+            )
         prev_ids = [str(p) for p in prev_ids]  # They may come as ints
 
         if get_domain_from_id(user_id) != origin: