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

Commit 03df9cf

Browse files
committed
Make sure prev_ids defaults to empty list
While this change seems a bit strange, I was seeing TypeErrors on my homeserver because someone is sending device lists where they explicitly set `"prev_id": null` which causes the next list comprehension to fail. Signed-off-by: Carl Bordum Hansen <[email protected]>
1 parent 39dee30 commit 03df9cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

synapse/handlers/device.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ async def incoming_device_list_update(
762762
user_id = edu_content.pop("user_id")
763763
device_id = edu_content.pop("device_id")
764764
stream_id = str(edu_content.pop("stream_id")) # They may come as ints
765-
prev_ids = edu_content.pop("prev_id", [])
765+
prev_ids = edu_content.pop("prev_id") or []
766766
prev_ids = [str(p) for p in prev_ids] # They may come as ints
767767

768768
if get_domain_from_id(user_id) != origin:

0 commit comments

Comments
 (0)