mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 22:44:18 -05:00
Fix crash admin media list api when info is None (#14537)
Fixes https://github.com/matrix-org/synapse/issues/14536
This commit is contained in:
parent
f6c74d1cb2
commit
c2e06c36d4
1
changelog.d/14537.bugfix
Normal file
1
changelog.d/14537.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix a long-standing bug where the [List media admin API](https://matrix-org.github.io/synapse/latest/admin_api/media_admin_api.html#list-all-media-in-a-room) would fail when processing an image with broken thumbnail information.
|
@ -912,7 +912,11 @@ class RoomWorkerStore(CacheInvalidationWorkerStore):
|
||||
event_json = db_to_json(content_json)
|
||||
content = event_json["content"]
|
||||
content_url = content.get("url")
|
||||
thumbnail_url = content.get("info", {}).get("thumbnail_url")
|
||||
info = content.get("info")
|
||||
if isinstance(info, dict):
|
||||
thumbnail_url = info.get("thumbnail_url")
|
||||
else:
|
||||
thumbnail_url = None
|
||||
|
||||
for url in (content_url, thumbnail_url):
|
||||
if not url:
|
||||
|
Loading…
Reference in New Issue
Block a user